Rotation Controller

From C4 Engine Wiki
Jump to navigation Jump to search

The Rotation Controller is a type of controller that causes a node to rotate forward or backward through a given angle. The Rotation Controller is built into the core engine, and it is one of four kinematic controllers that cause an object to follow an exact motion. Rigid bodies controlled by the Physics Manager are able to interact with kinematic objects, but they cannot stop kinematic objects or alter their motions. A kinematic object pushes rigid bodies out of its way no matter what.

Settings

The following settings are available for Rotation Controllers.

Setting

Description

Kinematic Controller Settings

Wake intersecting rigid bodies

Specifies whether sleeping rigid bodies in the path of the kinematic object are detected and awakened. If this is disabled, then the kinematic object will pass straight through any sleeping rigid bodies that it comes in contact with. If this is enabled, then sleeping rigid bodies that intersect the bounding box of the kinematic object are automatically awakened so they can interact with the kinematic object. For best performance, this setting should be disabled if it's known that the kinematic object will not come in contact with sleeping rigid bodies.

Rotation Controller Settings

Rotation angle (deg)

The angle through which the target node rotates, measured in degrees.

Rotation speed (deg/s)

The speed at which the target node rotates between two angles, measured in degrees of angle per second.

Acceleration time (s)

The length of time it takes for the target node to be accelerated to full speed when it starts rotating.

Deceleration time (s)

The length of time it takes for the target node to be decelerated to a stop when it stops rotating.

Center position connector key

The name of the connector attached to the target node that is connected to the center position for the rotation. The rotation occurs about the z axis of the connected node. Positive angles represent counterclockwise rotations when the z is pointing toward you.

Script Functions

The Rotation Controller defines the following functions that can be called from a script using the Call Controller Function method.

Function

Description

Get Rotation Speed

Returns the rotation speed and completes immediately.

Set Rotation Speed

Sets the rotation speed and completes immediately.

  • The Rotation speed (deg/s) setting specifies the new rotation speed in degrees per second.

Rotate to Start Angle

Begins rotating the target node to the start angle. This function completes when the target node reaches the start angle.

Rotate to Finish Angle

Begins rotating the target node to the finish angle. This function completes when the target node reaches the finish angle.

See Also