applyLocalForce method
void
applyLocalForce(
- Vector3 localForce,
- Vector3 localPoint
Apply force 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 applyLocalForce(Vector3 localForce, Vector3 localPoint){
if (type != BodyTypes.dynamic) {
return;
}
final worldForce = _bodyApplyLocalWorldForce;
final relativePointWorld = _bodyApplyLocalForceRelativePointWorld;
// Transform the force vector to world space
vectorToWorldFrame(localForce, worldForce);
vectorToWorldFrame(localPoint, relativePointWorld);
applyForce(worldForce, relativePointWorld);
}