Face value object.
Constructor
new(?vertices:Vector<Float>, ?uvs:Vector<Float>)
Creates a new Face value object.
Parameters:
vertices | [optional] 9 entries long Vector.<Number> representing the x, y and z of v0, v1, and v2 of a face |
|---|---|
uvs | [optional] 6 entries long Vector.<Number> representing the u and v of uv0, uv1, and uv2 of a face |
Variables
Methods
containsPoint(point:Vector3D, maxDistanceToPlane:Float = .007):Bool
Tests whether a given point is inside the triangle
Parameters:
point | The point to test against |
|---|---|
maxDistanceToPlane | The minimum distance to the plane for the point to be considered on the triangle. This is usually used to allow for rounding error, but can also be used to perform a volumetric test. |
getBarycentricCoords(point:Vector3D, ?target:Point):Point
Returns the first two barycentric coordinates for a point on (or outside) the triangle. The third coordinate is 1 - x - y
Parameters:
point | The point for which to calculate the new target |
|---|---|
target | An optional Point object to store the calculation in order to prevent creation of a new object |
getUVAtPoint(point:Vector3D, ?target:UV):UV
Returns the target coordinates for a point on a triangle
Parameters:
v0 | The triangle's first vertex |
|---|---|
v1 | The triangle's second vertex |
v2 | The triangle's third vertex |
uv0 | The UV coord associated with the triangle's first vertex |
uv1 | The UV coord associated with the triangle's second vertex |
uv2 | The UV coord associated with the triangle's third vertex |
point | The point for which to calculate the new target |
target | An optional UV object to store the calculation in order to prevent creation of a new object |
setUVat(index:Int, u:Float, v:Float):Void
To set uv values for either uv0, uv1 or uv2.
Parameters:
index | The id of the uv (0, 1 or 2) |
|---|---|
u | The horizontal coordinate of the texture value. |
v | The vertical coordinate of the texture value. |
setVertexAt(index:Int, x:Float, y:Float, z:Float):Void
To set uv values for either v0, v1 or v2.
Parameters:
index | The id of the uv (0, 1 or 2) |
|---|---|
x | The x value of the vertex. |
y | The y value of the vertex. |
z | The z value of the vertex. |