Packagesandy.math
Classpublic class VertexMath
InheritanceVertexMath Inheritance VectorMath

Math functions for vertex manipulation.



Public Methods
 MethodDefined by
  
Creates a VertexMath object.
VertexMath
 Inherited
[static] Adds two 3D vectors.
VectorMath
  
[static] Adds the two vertices.
VertexMath
  
[static] Clones a vertex.
VertexMath
  
cross(p_oW:Vertex, p_oV:Vertex):Vertex
[static] Computes the cross product the two vertices.
VertexMath
  
dot(p_oV:Vertex, p_oW:Vertex):Number
[static] Computes the dot product of the two vertices.
VertexMath
 Inherited
getAngle(p_oV:Vector, p_oW:Vector):Number
[static] Calculates the angle between two 3D vectors.
VectorMath
  
[static] Returns an instance of this class.
VertexMath
 Inherited
getNorm(p_oV:Vector):Number
[static] Computes the norm of a 3D vector.
VectorMath
  
[static] Computes the opposite of a vertex.
VertexMath
 Inherited
normalize(p_oV:Vector):Boolean
[static] Normalizes a 3d vector.
VectorMath
 Inherited
pow(p_oV:Vector, p_nExp:Number):Vector
[static] Computes the power of a 3D vector.
VectorMath
 Inherited
scale(p_oV:Vector, n:Number):Vector
[static] Multiplies a 3D vector by specified scalar.
VectorMath
  
sub(p_oV:Vertex, p_oW:Vertex):Vertex
[static] Substracts one vertices from another
VertexMath
Constructor detail
VertexMath()constructor
public function VertexMath()

Creates a VertexMath object.

This is a singleton constructor, and should not be called directly.
If called from outside the ColorMath class, it throws a SingletonError.

[ToDo: Why instantiate this at all? - all methods are class methods! ]
Method detail
addVertex()method
public static function addVertex(p_oV:Vertex, p_oW:Vertex):Vertex

Adds the two vertices.

[ToDo: Check here! We should add all the properties of the vertices! ]

Parameters
p_oV:Vertex — The first vertex
 
p_oW:Vertex — The second vertex

Returns
Vertex — The resulting vertex
clone()method 
public static function clone(p_oV:Vertex):Vertex

Clones a vertex.

Parameters
p_oV:Vertex — A vertex to clone.

Returns
Vertex — The clone
cross()method 
public static function cross(p_oW:Vertex, p_oV:Vertex):Vertex

Computes the cross product the two vertices.

Parameters
p_oW:Vertex — The first vertex
 
p_oV:Vertex — The second vertex

Returns
Vertex — The resulting cross product
dot()method 
public static function dot(p_oV:Vertex, p_oW:Vertex):Number

Computes the dot product of the two vertices.

Parameters
p_oV:Vertex — The first vertex
 
p_oW:Vertex — The second vertex

Returns
Number — The dot procuct
getInstance()method 
public static function getInstance():VertexMath

Returns an instance of this class.

Call this method to get an instance of VertexMath

Returns
VertexMath
negate()method 
public static function negate(p_oV:Vertex):Vertex

Computes the opposite of a vertex.

The "opposite" vertex is a vertex where all components are multiplied by -1

Parameters
p_oV:Vertex — The vertex.

Returns
Vertex — The opposite vertex.
sub()method 
public static function sub(p_oV:Vertex, p_oW:Vertex):Vertex

Substracts one vertices from another

Parameters
p_oV:Vertex — The vertex to subtract from
 
p_oW:Vertex — The vertex to subtract

Returns
Vertex — The resulting vertex