| Package | sandy.math |
| Class | public class VertexMath |
| Inheritance | VertexMath VectorMath |
| Method | Defined by | ||
|---|---|---|---|
|
Creates a VertexMath object.
| VertexMath | ||
![]() |
[static]
Adds two 3D vectors.
| VectorMath | |
|
[static]
Adds the two vertices.
| VertexMath | ||
|
[static]
Clones a vertex.
| VertexMath | ||
|
[static]
Computes the cross product the two vertices.
| VertexMath | ||
|
[static]
Computes the dot product of the two vertices.
| VertexMath | ||
![]() |
[static]
Calculates the angle between two 3D vectors.
| VectorMath | |
|
[static]
Returns an instance of this class.
| VertexMath | ||
![]() |
[static]
Computes the norm of a 3D vector.
| VectorMath | |
|
linearGradientMatrix(p_oV0:Vertex, p_oV1:Vertex, p_oV2:Vertex, p_nR0:Number, p_nR1:Number, p_nR2:Number, p_oMatrix:Matrix = null):Matrix
[static]
Calculates linear gradient matrix from three vertices and ratios.
| VertexMath | ||
|
[static]
Computes the opposite of a vertex.
| VertexMath | ||
![]() |
[static]
Normalizes a 3d vector.
| VectorMath | |
![]() |
[static]
Computes the power of a 3D vector.
| VectorMath | |
![]() |
[static]
Multiplies a 3D vector by specified scalar.
| VectorMath | |
![]() |
[static]
Returns a random vector contained betweeen the first and second values.
| VectorMath | |
|
[static]
Substracts one vertices from another.
| VertexMath | ||
| 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! ]
| addVertex | () | method |
public static function addVertex(p_oV:Vertex, p_oW:Vertex):VertexAdds the two vertices.
[ToDo: Check here! We should add all the properties of the vertices! ]
Parametersp_oV:Vertex — The first vertex.
|
|
p_oW:Vertex — The second vertex.
|
Vertex —
The resulting vertex.
|
| clone | () | method |
public static function clone(p_oV:Vertex):VertexClones a vertex.
Parametersp_oV:Vertex — A vertex to clone.
|
Vertex —
The clone.
|
| cross | () | method |
public static function cross(p_oW:Vertex, p_oV:Vertex):VertexComputes the cross product the two vertices.
Parametersp_oW:Vertex — The first vertex.
|
|
p_oV:Vertex — The second vertex.
|
Vertex —
The resulting cross product.
|
| dot | () | method |
public static function dot(p_oV:Vertex, p_oW:Vertex):NumberComputes the dot product of the two vertices.
Parametersp_oV:Vertex — The first vertex.
|
|
p_oW:Vertex — The second vertex.
|
Number — The dot procuct.
|
| getInstance | () | method |
public static function getInstance():VertexMathReturns an instance of this class.
Call this method to get an instance of VertexMath.
ReturnsVertexMath |
| linearGradientMatrix | () | method |
public static function linearGradientMatrix(p_oV0:Vertex, p_oV1:Vertex, p_oV2:Vertex, p_nR0:Number, p_nR1:Number, p_nR2:Number, p_oMatrix:Matrix = null):MatrixCalculates linear gradient matrix from three vertices and ratios.
This function expects vertices to be ordered in such a way that p_nR0 < p_nR1 < p_n2. Ratios can be scaled by any positive factor.
See flash.display.Graphics.beginGradientFill() documentation for ratios meaning.
Parametersp_oV0:Vertex — The leftmost vertex in a gradient.
|
|
p_oV1:Vertex — The inner vertex in a gradient.
|
|
p_oV2:Vertex — The rightmost vertex in a gradient.
|
|
p_nR0:Number — The ratio for the leftmost vertext.
|
|
p_nR1:Number — The ratio for the inner vertex.
|
|
p_nR2:Number — The ratio for the rightmost.
|
|
p_oMatrix:Matrix (default = null) — The matrix to use.
|
Matrix — The transformation matrix to use with beginGradientFill (GradientType.LINEAR only).
|
| negate | () | method |
public static function negate(p_oV:Vertex):VertexComputes the opposite of a vertex.
The opposite vertex is a vertex where all components are multiplied by -1.
p_oV:Vertex — The vertex.
|
Vertex —
The opposite vertex.
|
| sub | () | method |
public static function sub(p_oV:Vertex, p_oW:Vertex):VertexSubstracts one vertices from another.
Parametersp_oV:Vertex — The vertex to subtract from.
|
|
p_oW:Vertex — The vertex to subtract.
|
Vertex —
The resulting vertex.
|