Difference between revisions of "Body:getLocalVector"

m
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
Transform a vector from world coordinates to local coordinates.
  
Transform a vector from world coordinates to local coordinates.
 
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
local_x, local_y = Body:getLocalVector( world_x, world_y )
+
localX, localY = Body:getLocalVector( worldX, worldY )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
{{param|number|world_x|The vector x component in world coordinates.}}
+
{{param|number|worldX|The vector x component in world coordinates.}}
{{param|number|world_y|The vector y component in world coordinates.}}
+
{{param|number|worldY|The vector y component in world coordinates.}}
 
=== Returns ===
 
=== Returns ===
{{param|number|local_x|The vector x component in local coordinates.}}
+
{{param|number|localX|The vector x component in local coordinates.}}
{{param|number|local_y|The vector y component in local coordinates.}}
+
{{param|number|localY|The vector y component in local coordinates.}}
 +
 
 
== See Also ==
 
== See Also ==
 
* [[parent::Body]]
 
* [[parent::Body]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
{{#set:Description=Transform a vector from world coordinates to local coordinates.}}
 
{{#set:Description=Transform a vector from world coordinates to local coordinates.}}
 +
{{#set:Since=000}}
 +
 +
== Other Languages ==
 +
{{i18n|Body:getLocalVector}}

Latest revision as of 10:10, 26 January 2016

Transform a vector from world coordinates to local coordinates.

Function

Synopsis

localX, localY = Body:getLocalVector( worldX, worldY )

Arguments

number worldX
The vector x component in world coordinates.
number worldY
The vector y component in world coordinates.

Returns

number localX
The vector x component in local coordinates.
number localY
The vector y component in local coordinates.

See Also


Other Languages