Packageflare.physics.geom
Classpublic final class Triangle
InheritanceTriangle Inheritance Object
Implements flare.physics.IShape

A triangle object used to cache various information for MeshCollider objects.

See also

MeshCollider


Public Properties
 PropertyDefined By
  e0 : Edge
First edge of the triangle, vertex 0 to 1.
Triangle
  e1 : Edge
Second edge of the triangle, vertex 1 to 2.
Triangle
  e2 : Edge
Third edge of the triangle, vertex 2 to 0.
Triangle
  material : Material3D
The material of the surface that this triangle is part of.
Triangle
  n : Vector3D
The triangle normal.
Triangle
  v0 : Vertex
First vertex of the triangle.
Triangle
  v1 : Vertex
Second vertex of the triangle.
Triangle
  v2 : Vertex
Third vertex of the triangle.
Triangle
Public Methods
 MethodDefined By
  
Creates a new triangle object.
Triangle
  
closetPoint(p:Vector3D, out:Vector3D):Edge
The closet point to the triangle.
Triangle
  
getSupportPoints(axis:Vector3D, out:Vector.<Vector3D>):int
Get the support points along an arbitraty axis.
Triangle
  
isPoint(x:Number, y:Number, z:Number):Boolean
Test if a point is inside or not of the triangle.
Triangle
  
project(axis:Vector3D, info:AxisInfo):void
Projects the object along an arbitrary axis.
Triangle
Property Detail
e0property
public var e0:Edge

First edge of the triangle, vertex 0 to 1.

e1property 
public var e1:Edge

Second edge of the triangle, vertex 1 to 2.

e2property 
public var e2:Edge

Third edge of the triangle, vertex 2 to 0.

materialproperty 
public var material:Material3D

The material of the surface that this triangle is part of.

nproperty 
public var n:Vector3D

The triangle normal.

v0property 
public var v0:Vertex

First vertex of the triangle.

v1property 
public var v1:Vertex

Second vertex of the triangle.

v2property 
public var v2:Vertex

Third vertex of the triangle.

Constructor Detail
Triangle()Constructor
public function Triangle(v0:Vertex, v1:Vertex, v2:Vertex)

Creates a new triangle object.

Parameters
v0:Vertex — First vertex.
 
v1:Vertex — Second vertex.
 
v2:Vertex — Third vertex.
Method Detail
closetPoint()method
public final function closetPoint(p:Vector3D, out:Vector3D):Edge

The closet point to the triangle.

Parameters

p:Vector3D — The point to test.
 
out:Vector3D — The result closet point.

Returns
Edge
getSupportPoints()method 
public final function getSupportPoints(axis:Vector3D, out:Vector.<Vector3D>):int

Get the support points along an arbitraty axis.

Parameters

axis:Vector3D
 
out:Vector.<Vector3D>

Returns
int
isPoint()method 
public final function isPoint(x:Number, y:Number, z:Number):Boolean

Test if a point is inside or not of the triangle.

Parameters

x:Number — The x position of the point.
 
y:Number — The y position of the point.
 
z:Number — The z position of the point.

Returns
Boolean — True if the point is inside the triangle, otherwise, false.
project()method 
public final function project(axis:Vector3D, info:AxisInfo):void

Projects the object along an arbitrary axis.

Parameters

axis:Vector3D
 
info:AxisInfo