Skip to content

JumpDescriptor

Oğuz Eroğlu edited this page Aug 1, 2020 · 3 revisions

Definition

JumpDescriptor describes how a steerable jumps between two points. The jump starts from takeoffPosition and ends in landingPosition. Steerable goes towards the takeoffPosition until the distance between its position and the takeoffPositionis less thantakeoffPositionSatisfactionRadius`. Once the satisfaction radius is reached, the steerable performs a jump by setting its velocity to:

(vx calculated by JumpDescriptor, jumpSpeed of the steerable, vz calculated by JumpDescriptor).

Note that JumpDescriptor is designed to describe jumps on the axis Y.

Usage

// Steerable jumps at (100, 0, 0), lands at (150, 100, 0)
var jumpDescriptor = new Kompute.JumpDescriptor({
  takeoffPosition: new Kompute.Vector3D(100, 0, 0),
  landingPosition: new Kompute.Vector3D(150, 100, 0),
  takeoffPositionSatisfactionRadius: 35
});

Visualising

JumpDescriptors may be visualised via DebugHelper#visualiseJumpDescriptor API. See here.