Garry's Mod Wiki

PhysObj:CalculateVelocityOffset

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

Description

Calculates the linear and angular velocities on the center of mass for an offset impulse. The outputs can be directly passed to PhysObj:AddVelocity and PhysObj:AddAngleVelocity, respectively.

This will return zero length vectors if the physics object's motion is disabled. See PhysObj:IsMotionEnabled.

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
The calculated linear velocity from the impulse on the physics object's center of mass in source_unit/s. (World frame)
2 Vector
The calculated angular velocity from the impulse on the physics object's center of mass in degrees/s. (Local frame)