RigidBodyController::ApplyImpulse
Defined in:
Applies an impulse to a rigid body.
C4Physics.h
Prototype
void ApplyImpulse(const Vector3D& impulse);
void ApplyImpulse(const Vector3D& impulse, const Point3D& position);
Parameters
impulse |
The impulse to apply, in body-space coordinates. |
position |
The body-space position to which the impulse is applied. |
Description
The ApplyImpulse
function applies a one-time instantaneous impulse to a rigid body. The impulse is specified by the impulse
parameter and is measured in kilonewtons times seconds (kN⋅s). This function causes a force to be applied to the rigid body's center of mass during the next simulation step. A torque is also applied to the rigid body when the difference between the position
parameter and the rigid body's center of mass is not parallel to the direction of the impulse.The
impulse
and position
parameters are specified in the body-space coordinates for the target node of the rigid body controller. If the position
parameter is omitted, then the impulse is applied to the rigid body's center of mass.If the
ApplyImpulse
function is called multiple times for the same rigid body between simulation steps, then the forces and torques that get applied are accumulated.
See Also
RigidBodyController::GetExternalForce
RigidBodyController::SetExternalForce