MovableObject Orientation and Reference Frames

Frames of Reference

All spatial coordinates for a MovableObject refer to the object's frame of reference.

Movable Object Orientation

An object's orientation may either defined as relative to the parent object's reference frame, or relative to the node's velocity within the parent object's reference frame. By default, orientation is specified as relative to the node's velocity. Thus, by default an object will "point" in the direction that it is moving within its parent's reference frame.

Relative to Parent

When a movable object's orientation is relative to its parent, its orientation is a child of the parent's orientation.

This mode is specified using MovableObject.setOrientationMode(OM_PARENT).

Relative to Velocity

When a movable objects orientation is relative to its velocity within the parent object's reference frame, an additional orientation is introduced: DirRelativeOrientation. DirRelativeOrientation specifies the orientation of an object's velocity within its parent's reference frame. In this case, DirRelativeOrientation is a child of the parent object's orientation. The child object's orientation is then a child of DirRelativeOrientation.

In case the movable object is stationary in its parent's reference frame, the last non-zero velocity is used to compute the orientation. The default non-zero velocity is along the X axis in its parent's frame of reference.

This mode is specified using MovableObject.setOrientationMode(OM_VELOCITY).

Several examples are provided in Orientation Examples.