Garry's Mod Wiki

PhysObj:WorldToLocalVector

  Vector PhysObj:WorldToLocalVector( Vector vec )

Description

Rotationally transforms a worldspace vector into the physics object's local space by the inverted PhysObj:GetPositionMatrix.

For example, in GMod this is used in thrusters, for working out linear force for local acceleration.

In contrast to PhysObj:WorldToLocal, this function doesn't translate the vector.

Arguments

1 Vector vec
A worldspace vector.

Returns

1 Vector
The resulting vector from the rotational transformation.