Spin Controller

From C4 Engine Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The Spin Controller is a type of controller that causes a node to continuously spin about a particular axis. The Spin 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 Spin 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.

Spin Controller Settings

Spin speed (rev/s)

The speed at which the target node spins, measured in the number of complete revolutions per second. The reciprocal of this number gives the period of one full revolution in seconds.

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 Spin Controller defines the following functions that can be called from a script using the Call Controller Function method.

Function

Description

Get Spin Speed

Returns the spin speed and completes immediately.

Set Spin Speed

Sets the spin speed and completes immediately.

  • The Spin speed (rev/s) setting specifies the new spin speed in revolutions per second.
  • The Acceleration time (s) setting specifies the length of time, in seconds, it takes to reach the new spin speed.

See Also