Garry's Mod Wiki

PhysObj:LocalToWorld

  Vector PhysObj:LocalToWorld( Vector vecLocal )

Description

Translates a vector in the local space of the physics object into worldspace coordinates.

Internally transforms the vector by the PhysObj:GetPositionMatrix()'s rotation & translation.

So in GLua it approximates to:

local matrixWorldTransform = PhysObj:GetPositionMatrix() local vecWorldspaced = Vector() vecWorldspaced:Set( vecLocal ) vecWorldspaced:Mul( matrixWorldTransform ) return vecWorldspaced

Arguments

1 Vector vecLocal
A vector in the physics object's local space.

Returns

1 Vector
The correspondent worldspace vector.