Orientation
To make objects orient in the direction of travel, use orientationForce . This is also demonstrated in the attraction force demo above.
The parameter given to the force is the ‘interpolation amount’, which determines how quickly rotation happens.
The orientation force is a handy composite which applies the following forces in order:
- angularForce - updates angle and velocity based on angular acceleration & velocity
- angleFromAccelerationForce - update angularAcceleration based on acceleration’s vector, and
- angleFromVelocityForce - update angle based on velocity, to point in direction of travel