Cannon.Math.Vector2D
y-lohse edited this page Jan 12, 2013
·
2 revisions
Represents a vector in 2 dimensional space. Most methods return the same Vector2D object, making calls chainable.
- __construct
- clone
- add
- substract
- multiply
- equals
- length
- normalize
- rightNormal
- leftNormal
- dir
- proj
- projLength
- dotProduct
- crossProduct
- x:Float
- y:Float
Creates a new Vector2D
Returns a clone of the current vector.
- v2:Vector2D
Adds another vector to this.
- v2:Vector2D
subtracts another vector to this.
- magnitude:Float
Multiplies the current vector by a given value.
- v2:Vector2D
Determines whether two vectors are equal
Computes the length of the current vector
Normalizes the current vector
Returns the right normal of the current vector
Returns the left normal of the current vector
Returns a new vector representing the direction of the current vector
- v2:Vector2D
Projects this onto v2 and returns the resulting vector
- v2:Vector2D
Retuns the projection length of this and v2
- v2:Vector2D
Computes the dot product of this and v2
- v2:Vector2D
Computes the cross product of this and v2