- All Implemented Interfaces:
- com.jme3.export.Savable, com.jme3.scene.control.Control
public class PathFollowBehaviour
extends AbstractStrengthSteeringBehaviour
"Path following behavior enables a character to steer along a predetermined path, such as a
roadway, corridor or tunnel. This is distinct from constraining a vehicle rigidly to a path like a
train rolling along a track. Rather path following behavior is intended to produce motion such
as people moving down a corridor: the individual paths remain near, and often parallel to, the
centerline of the corridor, but are free to deviate from it. In the implementation described here,
a path will be idealized as a spine and a radius. The spine" is represented as a "poly-line (a series
of connected line segments). The path is then a tube or generalized cylinder: a circle of the specified
radius, swept along the specified spine. The goal of the path following steering behavior is
to move a character along the path while taying within the specified radius of the spine.
If the character is initially far away from the path, it must first approach, then follow the path."
"To compute steering for path following, a velocity-based prediction is made of the character's
future position. The predicted future position is projected onto the nearest point on the path spine.
If this projection distance (from the predicted position to the nearest on-path point) is less than
the path radius, then the character is deemed to be correctly following the path and no corrective
steering is required. Otherwise the character is veering away from the path, or is too far away from
the path. To steer back towards the path, the seek behavior is used to steer towards the on-path
projection of the predicted future position. A null or zero value is returned if no corrective steering
is required."
If you need the agent to pass exactly from the beginning of the first spine you must use seek before
activating path follow.
- Version:
- 1.0.1
- Author:
- Jesús Martín Berlanga