Garry's Mod Wiki

PhysObj:CalculateForceOffset

  Vector, Vector PhysObj:CalculateForceOffset( Vector impulse, Vector position )

Description

Calculates the linear and angular impulse on the object's center of mass for an offset impulse.
The outputs can be used with PhysObj:ApplyForceCenter and PhysObj:ApplyTorqueCenter, respectively.

Be careful to convert the angular impulse to world frame (PhysObj:LocalToWorldVector) if you are going to use it with ApplyTorqueCenter.

Arguments

1 Vector impulse
The impulse acting on the object in kg*source_unit/s. (World frame)
2 Vector position
The location of the impulse in world coordinates (source units)

Returns

1 Vector linearImpulse
The calculated linear impulse on the physics object's center of mass in kg*source_unit/s. (World frame)
2 Vector angularImpulse
The calculated angular impulse on the physics object's center of mass in kg*m^2*degrees/s. (Local frame)