IMeshData

interface IMeshData(source)

Interface representing mesh data in 3D space.

Provides access to vertices and polygonal structure, along with methods for common mesh transformations and manipulations.

Inheritors

Properties

Link copied to clipboard
val IMeshData.bounds: Box

Provides the bounding box of the mesh based on its polygons and associated vertex data.

Link copied to clipboard

Represents the list of indexed polygons that define the structure of the mesh.

Link copied to clipboard
abstract val vertexData: IVertexData

Provides vertex data for the mesh, including positions, normals, colors, texture coordinates, tangents, and bitangents. This data is central to defining the geometric and visual properties of the mesh and can be used for performing various operations and transformations.

Functions

Link copied to clipboard

Checks if all polygons in the mesh are triangular.

Link copied to clipboard
abstract fun join(other: IMeshData): IMeshData

Combines the current mesh data with another mesh data instance.

Link copied to clipboard
abstract fun toMeshData(): MeshData

Converts the current mesh data into an immutable MeshData instance.

Link copied to clipboard

Converts the current mesh data into a mutable representation.

Link copied to clipboard
abstract fun toPolygons(): List<IPolygon>

Converts the current mesh data into a list of polygons.

Link copied to clipboard
fun IMeshData.toVertexBuffer(elementOffset: Int = 0, vertexBuffer: VertexBuffer? = null): VertexBuffer

Converts the current mesh data into a VertexBuffer representation, preparing geometry for rendering.

Link copied to clipboard
abstract fun triangulate(): IMeshData

Converts the current mesh data into a fully triangulated form.

Link copied to clipboard
fun IMeshData.weld(positionFractBits: Int, textureCoordFractBits: Int = -1, colorFractBits: Int = -1, normalFractBits: Int = -1, tangentFractBits: Int = -1, bitangentFractBits: Int = -1): MeshData

Welds the mesh data by consolidating vertices based on specified fractional bit precision for attributes such as positions, texture coordinates, colors, normals, tangents, and bitangents. This reduces redundant vertices and optimizes the mesh structure.

Link copied to clipboard
fun IMeshData.wireframe(): List<List<Vector3>>

Generates a wireframe representation of the mesh.