Garry's Mod Wiki

Revision Difference

Global.LocalToWorld#514888

<function name="LocalToWorld" parent="Global" type="libraryfunc">⤶ <description>⤶ Translates the specified position and angle from the specified local coordinate system into worldspace coordinates.⤶ ⤶ If you're working with an entity's local vectors, use <page>Entity:LocalToWorld</page> and/or <page>Entity:LocalToWorldAngles</page> instead.⤶ ⤶ See also: <page>Global.WorldToLocal</page>, the reverse of this function.⤶ </description>⤶ <realm>Shared</realm>⤶ <args>⤶ <arg name="localPos" type="Vector">The position vector in the source coordinate system, that should be translated to world coordinates</arg>⤶ <arg name="localAng" type="Angle">The angle in the source coordinate system, that should be converted to a world angle. If you don&#x27;t need to convert an angle, you can supply an arbitrary valid angle (e.g. &amp;amp;lt;kbd&amp;amp;gt;&lt;page&gt;Global.Angle&lt;/page&gt;()&amp;amp;lt;/kbd&amp;amp;gt;).</arg>⤶ <arg name="originPos" type="Vector">The origin point of the source coordinate system, in world coordinates</arg>⤶ <arg name="originAngle" type="Angle">The angles of the source coordinate system, as a world angle</arg>⤶ </args>⤶ <rets>⤶ <ret name="" type="Vector">The world position of the supplied local position.</ret>⤶ <ret name="" type="Angle">The world angles of the supplied local angle.</ret>⤶ </rets>⤶ </function>⤶ ⤶