Garry's Mod Wiki

Revision Difference

PhysObj:LocalToWorld#565511

<function name="LocalToWorld" parent="PhysObj" type="classfunc"> <description> Remaps a vector in the local space of the physics object to worldspace coordinates. Translates a vector in the local space of the physics object into worldspace coordinates. <note>Internally transforms the vector by the `PhysObj:GetPositionMatrix()`'s rotation & translation. So in GLua it would approximate to: ``` local matrix = PhysObj:GetPositionMatrix() local vecResult = Vector() vecResult:Set( vecLocal ) vecResult:Mul( matrix ) ``` </note> </description> <realm>Shared</realm> <args> <arg name="vecLocal" type="Vector">A vector in the physics object's local space</arg> </args> <rets> <ret name="" type="Vector">The corresponding vector in worldspace coordinates</ret> </rets> </function>