Oscillation Controller

From C4 Engine Wiki
Jump to navigation Jump to search

The Oscillation Controller is a type of controller that causes a node to oscillate between two positions on a sine wave. The Oscillation 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 Oscillation 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.

Oscillation Controller Settings

Oscillation speed (cycles/s)

The speed at which the target node oscillates between two positions, measured in the number of complete cycles per second. The reciprocal of this number gives the period of one full oscillation in seconds.

Start position connector key

The name of the connector attached to the target node that is connected to the start position for the oscillation.

Finish position connector key

The name of the connector attached to the target node that is connected to the finish position for the oscillation.

Script Functions

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

Widget

Description

Get Oscillation Speed

Returns the oscillation speed and completes immediately.

Set Oscillation Speed

Sets the oscillation speed and completes immediately.

  • The Oscillation speed (cycles/s) setting specifies the new oscillation speed in cycles per second.
  • The Acceleration time (s) setting specifies the length of time, in seconds, it takes to reach the new oscillation speed.

See Also