| Package | sandy.core.data |
| Class | public final class Vertex |
A vertex is a point which can be represented in different coordinate systems.
| Property | Defined by | ||
|---|---|---|---|
| aFaces : Array
An array of faces.
| Vertex | ||
| nbFaces : uint = 0
Number of polygons this vertex belongs to.
| Vertex | ||
| projected : Boolean = false
Has this vertex been projected? State flag.
| Vertex | ||
| sx : Number
properties used to store transformed coordinates in screen World.
| Vertex | ||
| sy : Number | Vertex | ||
| wx : Number
properties used to store transformed positions in the World coordinates
| Vertex | ||
| wy : Number | Vertex | ||
| wz : Number | Vertex | ||
| x : Number | Vertex | ||
| y : Number | Vertex | ||
| z : Number | Vertex | ||
| Method | Defined by | ||
|---|---|---|---|
|
Vertex(p_nx:Number = 0, p_ny:Number = 0, p_nz:Number = 0, ... rest)
Creates a new vertex.
| Vertex | ||
|
Adds a specified vertex to this vertex.
| Vertex | ||
|
Returns a clone of this vertex.
| Vertex | ||
|
Returns a new vertex build on the transformed values of this vertex.
| Vertex | ||
|
Makes this vertex equal to the specified vertex.
| Vertex | ||
|
[static]
Creates and returns a new vertex from the specified vector.
| Vertex | ||
|
Returns the cross product between this vertex and the specified vertex.
| Vertex | ||
|
deserialize(convertFrom:String):void
Sets the elements of this vertex from a string representation.
| Vertex | ||
|
Returns the dot product between this vertex and a specified vertex.
| Vertex | ||
|
Is this vertex equal to the specified vertex?.
| Vertex | ||
|
Returns the angle between this vertex and the specified vertex.
| Vertex | ||
|
getNorm():Number
Returns the norm of this vertex.
| Vertex | ||
|
Returns the 2D position of this vertex.
| Vertex | ||
|
Returns a vector representing the original x, y, z values.
| Vertex | ||
|
Returns the transformed vertex in world coordinates.
| Vertex | ||
|
Return the invers of this vertex.
| Vertex | ||
|
normalize():void
Normalizes this vertex.
| Vertex | ||
|
pow(pow:Number):void
Raises the vertex to the specified power.
| Vertex | ||
|
scale(n:Number):void
Multiplies this vertex by the specified scalar value.
| Vertex | ||
|
serialize(decPlaces:Number = 0):String
Returns a string representation of this vertex with rounded values.
| Vertex | ||
|
Substracts a specified vertex from this vertex.
| Vertex | ||
|
toString(decPlaces:Number = 0):String
Returns a string representing this vertex.
| Vertex | ||
| Constant | Defined by | ||
|---|---|---|---|
| id : uint | Vertex | ||
| aFaces | property |
public var aFaces:ArrayAn array of faces.
[ToDo: This isn't used - is it ;-P ]
| nbFaces | property |
public var nbFaces:uint = 0Number of polygons this vertex belongs to.
Default value is 0.
| projected | property |
public var projected:Boolean = falseHas this vertex been projected? State flag.
Default value is false.
| sx | property |
public var sx:Numberproperties used to store transformed coordinates in screen World.
| sy | property |
public var sy:Number
| wx | property |
public var wx:Numberproperties used to store transformed positions in the World coordinates
| wy | property |
public var wy:Number
| wz | property |
public var wz:Number
| x | property |
public var x:Number
| y | property |
public var y:Number
| z | property |
public var z:Number
| Vertex | () | constructor |
public function Vertex(p_nx:Number = 0, p_ny:Number = 0, p_nz:Number = 0, ... rest)Creates a new vertex.
Parametersp_nx:Number (default = 0) — The x position
|
|
p_ny:Number (default = 0) — The y position
|
|
p_nz:Number (default = 0) — The z position
|
|
... rest — optional values for wx, wy, wz
|
| add | () | method |
public final function add(v:Vertex):voidAdds a specified vertex to this vertex.
Parametersv:Vertex — The vertex to add to this vertex
|
| clone | () | method |
| clone2 | () | method |
public final function clone2():VertexReturns a new vertex build on the transformed values of this vertex.
A new vertex is created with this vertex's transformed coordinates as start position.
So ( x, y, z ) of the new vertex is the ( wx, wy, wz ) of this vertex.
[ToDo: What can this one be used for? - Explain! ]
ReturnsVertex —
The new vertex
|
| copy | () | method |
public final function copy(p_oVector:Vertex):voidMakes this vertex equal to the specified vertex.
All components of the argument vertex are copied to this vertex.
Parametersp_oVector:Vertex — The vertex to copy to this
|
| createFromVector | () | method |
public static function createFromVector(p_v:Vector):VertexCreates and returns a new vertex from the specified vector.
Parametersp_v:Vector — The vertex position vector
|
Vertex —
The new vertex
|
| cross | () | method |
public final function cross(v:Vertex):VertexReturns the cross product between this vertex and the specified vertex.
Only the original positions values are used for this cross product.
Parametersv:Vertex — The vertex to make a cross product with
|
Vertex —
the resulting vertex of the cross product.
|
| deserialize | () | method |
public final function deserialize(convertFrom:String):voidSets the elements of this vertex from a string representation.
[ToDo: Explain why this is good for XML intput! ]
ParametersconvertFrom:String — A string representing the vertex ( specific serialize format )
|
| dot | () | method |
public final function dot(w:Vertex):NumberReturns the dot product between this vertex and a specified vertex.
Only the original positions values are used for this dot product.
Parametersw:Vertex — The vertex to make a dot product with
|
Number — The dot product
|
| equals | () | method |
public final function equals(p_vertex:Vertex):BooleanIs this vertex equal to the specified vertex?.
This vertex is compared to the argument vertex, component by component.
If all components of the two vertices are equal, a true value is returned.
Parameters
p_vertex:Vertex |
Boolean — true if the vertices are considered equal, false otherwise
|
| getAngle | () | method |
public final function getAngle(w:Vertex):NumberReturns the angle between this vertex and the specified vertex.
Parametersw:Vertex — The vertex making an angle with this one
|
Number — The angle in radians
|
| getNorm | () | method |
public final function getNorm():NumberReturns the norm of this vertex.
The norm of the vertex is calculated as the length of its position vector.
That is sqrt( x + y + z )
Number — The norm
|
| getScreenPoint | () | method |
public function getScreenPoint():VectorReturns the 2D position of this vertex. This 2D position is the position on the screen after the camera projection. WARNING: There's actually a third value (the z one) which correspond to the depth screen position.
ReturnsVector —
Vector The 2D position of this vertex once projected.
|
| getVector | () | method |
public final function getVector():VectorReturns a vector representing the original x, y, z values.
ReturnsVector —
The vector
|
| getWorldVector | () | method |
public final function getWorldVector():VectorReturns the transformed vertex in world coordinates.
ReturnsVector |
| negate | () | method |
public final function negate():VertexReturn the invers of this vertex.
A new vertex is created with the negative of all values in this vertex.
ReturnsVertex —
The invers
|
| normalize | () | method |
public final function normalize():voidNormalizes this vertex.
Normalization means that all components of the vertex are divided by its norm.
The norm is calculated as the sqrt(x + y + z), that is the length of the position vector.
| pow | () | method |
public final function pow(pow:Number):voidRaises the vertex to the specified power.
All components of this vertex is raised to the power specified in the argument.
Parameterspow:Number — { |
| scale | () | method |
public final function scale(n:Number):voidMultiplies this vertex by the specified scalar value.
All components of the vertex are multiplied by the specified value
Parametersn:Number — The number to multiply with
|
| serialize | () | method |
public final function serialize(decPlaces:Number = 0):StringReturns a string representation of this vertex with rounded values.
[ToDo: Explain why this is good for XML output! ]
ParametersdecPlaces:Number (default = 0) — Number of decimals
|
String — The specific serialize string
|
| sub | () | method |
public function sub(v:Vertex):voidSubstracts a specified vertex from this vertex.
Parametersv:Vertex — The vertex to subtract from this vertex
|
| toString | () | method |
public final function toString(decPlaces:Number = 0):StringReturns a string representing this vertex.
ParametersdecPlaces:Number (default = 0) — Number of decimals
|
String — The representation
|
| id | constant |
public const id:uint