Physics Basic Shape: OnCompleteRotation
Invoked when the physics basic shape completes rotation specified by Rotate.
Event
void xxxxxxxxxxxxxxxxx(sender: object, direction: float, tilt: float, roll: float);
Parameters
Name | Type | Description |
---|---|---|
sender | Object | The physics basic shape object that has completed the rotation |
direction | Number | the direction of the physics basic shape in degrees |
tilt | Number | the tilt of the physics basic shape in degrees |
roll | Number | the roll of the physics basic shape in degrees |
Example
function OnSimulationStart()
{
let shape = GetComponentByNameAndType("PhysicsBasicShape1", "Physics Basic Shape");
SubscribeToEvent("OnCompleteRotation", shape.Name, "Physics Basic Shape", ReportRotation);
shape.Rotate(30, 40, 50, 10, 10, 10);
}
function ReportRotation(shape, direction, tilt, roll)
{
LogDebug(`Physics Basic Shape "${shape.Name}" has completed a rotation.`);
LogDebug(`direction=${direction} tilt=${tilt} roll=${roll}`);
}