Helper Class for face manipulationFaceHelper

Static methods

staticaddFace(mesh:Mesh, v0:Vertex, v1:Vertex, v2:Vertex, uv0:UV, uv1:UV, uv2:UV, subGeomIndice:Int):Void

staticaddFaces(mesh:Mesh, v0s:Vector<Vertex>, v1s:Vector<Vertex>, v2s:Vector<Vertex>, uv0s:Vector<UV>, uv1s:Vector<UV>, uv2s:Vector<UV>, subGeomIndices:Vector<UInt>):Void

Adds a series of faces from a mesh. All vectors must have the same length.

Parameters:

mesh

Mesh. The mesh to remove a face from

v0s

A vector with a series of Vertex Objects representing the v0 of a face.

v1s

A vector with a series of Vertex Objects representing the v1 of a face.

v2s

A vector with a series of Vertex Objects representing the v2 of a face.

uv0s

A vector with a series of UV Objects representing the uv0 of a face.

uv1s

A vector with a series of UV Objects representing the uv1 of a face.

uv2s

A vector with a series of UV Objects representing the uv2 of a face.

@:value({ out : null })staticgetFaceNormal(v0:Vertex, v1:Vertex, v2:Vertex, ?out:Vertex):Vertex

@:value({ out : null, uvScaleV : 1 })staticgetFaceTangent(v0:Vertex, v1:Vertex, v2:Vertex, uv0V:Float, uv1V:Float, uv2V:Float, uvScaleV:Float = 1, ?out:Vertex):Vertex

staticquarterFace(mesh:Mesh, indice:Int, subGeomIndice:Int):Void

Divides a face into 4 faces.

Parameters:

mesh

The mesh holding the face to split in 4.

indice

The face index. The value represents the position in indices vector divided by 3. For instance, to edit face [1], the parameter indice will be 1. The x value of the v0 at position 9 in vertices vector is then extracted from vertices[indices[indice*3]]

subGeomIndice

The index of the subgeometry holder this face.

staticquarterFaces(mesh:Mesh):Void

Divides all the faces of a mesh in 4 faces.

Parameters:

mesh

The mesh holding the faces to split in 4 At this time of dev, quarterFaces method will abort if a subgeometry reaches max buffer limit of 65k

staticremoveFace(mesh:Mesh, index:Int, subGeomIndice:Int):Void

Remove a face from a mesh

Parameters:

mesh

Mesh. The mesh to remove a face from

index

uint. Index of the face in vertices. The value represents the position in indices vector divided by 3. For instance, to edit face [1], the parameter indice will be 1. The x value of the v0 at position 3 in vertice vector is then extracted from vertices[indices[indice]]

subGeomIndice

uint. Index of vertex 1 of the face

staticremoveFaces(mesh:Mesh, indices:Vector<UInt>, subGeomIndices:Vector<UInt>):Void

Remove a series of faces from a mesh. Indices and geomIndices must have the same length. Meshes with less that 20k faces and single material, will generally only have one single subgeometry. The geomIndices vector will then contain only zeros. IMPORTANT: the code considers the indices as location in the mesh subgemeometry indices vector, not the value at the pointer location.

Parameters:

mesh

Mesh. The mesh to remove a face from

indices

A vector with a series of uints indices: the indices of the faces to be removed.

subGeomIndices

A vector with a series of uints indices representing the subgeometries of the faces to be removed.

@:value({ side : 0 })staticsplitFace(mesh:Mesh, indice:Int, subGeomIndice:Int, side:Int = 0):Void

Divides a face into 2 faces.

Parameters:

mesh

The mesh holding the face to split in 2

indice

The face index. The value represents the position in indices vector divided by 3. For instance, to edit face [1], the parameter indice will be 1. The x value of the v0 at position 9 in vertices vector is then extracted from vertices[indices[indice*3]]

subGeomIndice

The index of the subgeometry holder this face.

side

[optional] The side of the face to split in two. 0 , 1 or 2. (clockwize).

staticsplitFaces(mesh:Mesh):Void

Divides all the faces of a mesh in 2 faces.

Parameters:

mesh

The mesh holding the faces to split in 2

face

The face index. The value represents the position in indices vector divided by 3.

side

The side of the face to split in two. 0 , 1 or 2. (clockwize). At this time of dev, splitFaces method will abort if a subgeometry reaches max buffer limit of 65k

statictriFace(mesh:Mesh, indice:Int, subGeomIndice:Int):Void

Divides a face into 3 faces.

Parameters:

mesh

The mesh holding the face to split in 3.

indice

The face index. The value represents the position in indices vector divided by 3. For instance, to edit face [1], the parameter indice will be 1. The x value of the v0 at position 9 in vertices vector is then extracted from vertices[indices[indice*3]]

subGeomIndice

The index of the subgeometry holder this face.

statictriFaces(mesh:Mesh):Void

Divides all the faces of a mesh in 3 faces.

Parameters:

mesh

The mesh holding the faces to split in 3 At this time of dev, triFaces method will abort if a subgeometry reaches max buffer limit of 65k