Difference between revisions of "Contact:getNormal"

m (1 revision: Importing from potato (again).)
(add detail)
Line 1: Line 1:
  
 +
== Function ==
 +
Get the normal vector between two shapes that are in contact.
  
== Function ==
+
This function returns the coordinates of a unit vector that points from the first shape to the second.
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
Contact:getNormal( )
+
nx, ny = Contact:getNormal( )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
 
None.
 
None.
 
=== Returns ===
 
=== Returns ===
Nothing.
+
{{param|number|nx|The x component of the normal vector.}}
 +
{{param|number|my|The y component of the normal vector.}}
 
== See Also ==
 
== See Also ==
 
* [[parent::Contact]]
 
* [[parent::Contact]]
 
[[Category:Functions]]
 
[[Category:Functions]]
{{#set:Description=}}
+
{{#set:Description=Get the normal vector between two shapes that are in contact.}}

Revision as of 17:52, 6 March 2010

Function

Get the normal vector between two shapes that are in contact.

This function returns the coordinates of a unit vector that points from the first shape to the second.

Synopsis

nx, ny = Contact:getNormal( )

Arguments

None.

Returns

number nx
The x component of the normal vector.
number my
The y component of the normal vector.

See Also