TangentSpaceMesh

Builds Filament-style TANGENTS buffers (tangent-space quaternions) from an input mesh, with a choice of algorithms. Supersedes SurfaceOrientation.

If the chosen algorithm didn't remesh the input (remeshed), use the data you provided instead of querying it back. Getting positions or UVs that weren't provided as input aborts.

Constructors

Link copied to clipboard
constructor(nativeHandle: NativePointer)

Types

Link copied to clipboard

The tangent-space algorithm.

Link copied to clipboard

Auxiliary vertex attributes: they don't affect the tangent space, but are mapped when the mesh is remeshed.

Link copied to clipboard
class Builder

Collects the input mesh. Strides are in bytes; 0 means tightly packed.

Properties

Link copied to clipboard

The native object, for interop with code calling the Fila* C API directly. Read-only: this wrapper owns it.

Link copied to clipboard

Whether the algorithm remeshed the input: then read positions, UVs and triangles back.

Link copied to clipboard

The number of output triangles.

Link copied to clipboard

The number of output vertices, which differs from the input's if the mesh was remeshed.

Functions

Link copied to clipboard
open override fun close()

Same as destroy; lets this be used with use { } and try-with-resources.

Link copied to clipboard
fun destroy()

Frees the mesh.

Link copied to clipboard
fun getAux(attribute: TangentSpaceMesh.AuxAttribute, out: FloatArray, components: Int, stride: Int = 0)

Copies out an auxiliary attribute given to Builder.aux as floats, components (2–4) per vertex.

fun getAux(attribute: TangentSpaceMesh.AuxAttribute, out: ShortArray, components: Int, stride: Int = 0)

Copies out an auxiliary attribute given to Builder.aux as unsigned shorts, components (3–4) per vertex.

Link copied to clipboard
fun getHalfQuats(out: ShortArray, stride: Int = 0)

Copies out the tangent-space quaternions as 4 half floats per vertex (quath).

Link copied to clipboard
fun getPositions(out: FloatArray, stride: Int = 0)

Copies out the output positions, 3 floats per vertex.

Link copied to clipboard
fun getQuats(out: FloatArray, stride: Int = 0)

Copies out the tangent-space quaternions, 4 floats per vertex.

fun getQuats(out: ShortArray, stride: Int = 0)

Copies out the tangent-space quaternions as 4 normalized shorts per vertex (short4).

Link copied to clipboard

Copies out the output triangles in 32-bit indices, 3 per triangle.

Copies out the output triangles in 16-bit indices, 3 per triangle.

Link copied to clipboard
fun getUVs(out: FloatArray, stride: Int = 0)

Copies out the output UVs, 2 floats per vertex.