Face value object.

Constructor

@:value({ uvs : null, vertices : null })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

read onlyuv0u:Float

read onlyuv0v:Float

read onlyuv1u:Float

read onlyuv1v:Float

read onlyuv2u:Float

read onlyuv2v:Float

read onlyv0:Vector<Float>

read onlyv0x:Float

read onlyv0y:Float

read onlyv0z:Float

read onlyv1:Vector<Float>

read onlyv1x:Float

read onlyv1y:Float

read onlyv1z:Float

read onlyv2:Vector<Float>

read onlyv2x:Float

read onlyv2y:Float

read onlyv2z:Float

Methods

clone():Face

returns a new Face value Object

@:value({ maxDistanceToPlane : .007 })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.

@:value({ target : null })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

@:value({ target : null })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.

setUv0Value(u:Float, v:Float):Void

uv0 u and v values

Parameters:

u

The u value

v

The v value

setUv1Value(u:Float, v:Float):Void

uv1 u and v values

Parameters:

u

The u value

v

The v value

setUv2Value(u:Float, v:Float):Void

uv2 u and v values

Parameters:

u

The u value

v

The v 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.