Garry's Mod Wiki

Revision Difference

PhysObj:WorldToLocalVector#565528

<function name="WorldToLocalVector" parent="PhysObj" type="classfunc"> <description> Rotate a vector from the world frame to the local frame of the physics object. ⤶ <note>This function only rotates the vector, without any translation operation.</note>⤶ Transforms a worldspace vector into the local space of the physics object merely by the rotation of the **inverted** `PhysObj:GetPositionMatrix()`. ⤶ In contrast to <page>PhysObj:WorldToLocal</page>, this function doesn't translate the vector. </description> <realm>Shared</realm> <args> <arg name="WorldVec" type="Vector">A vector in the world frame</arg>⤶ <arg name="vec" type="Vector">A worldspace vector.</arg>⤶ </args> <rets> <ret name="" type="Vector">The corresponding vector relative to the PhysObj</ret>⤶ <ret name="" type="Vector">The result vector of the transformation by rotation.</ret>⤶ </rets> </function>