applyLocalImpulse method
void
applyLocalImpulse(
- Vector3 localImpulse,
- Vector3 localPoint
Apply locally-defined impulse to a local point in the body. @param force The force vector to apply, defined locally in the body frame. @param localPoint A local point in the body to apply the force on.
Implementation
void applyLocalImpulse(Vector3 localImpulse, Vector3 localPoint){
if (type != BodyTypes.dynamic) {
return;
}
final worldImpulse = _bodyApplyLocalImpulseWorldImpulse;
final relativePointWorld = _bodyApplyLocalImpulseRelativePoint;
// Transform the force vector to world space
vectorToWorldFrame(localImpulse, worldImpulse);
vectorToWorldFrame(localPoint, relativePointWorld);
applyImpulse(worldImpulse, relativePointWorld);
}