MutableMeshData

data class MutableMeshData(val vertexData: MutableVertexData, val polygons: MutableList<IndexedPolygon>) : IMeshData(source)

Represents mutable mesh data with modifiable vertex data and polygonal structure.

Constructors

Link copied to clipboard
constructor(vertexData: MutableVertexData, polygons: MutableList<IndexedPolygon>)

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
open override val polygons: MutableList<IndexedPolygon>

Mutable list of indexed polygons defining the geometric structure of the mesh.

Link copied to clipboard
open override val vertexData: MutableVertexData

Mutable vertex data instance containing positions, texture coordinates, colors, normals, tangents, and bitangents of vertices.

Functions

Link copied to clipboard

Checks if all polygons in the mesh are triangular.

Link copied to clipboard
open override fun join(other: IMeshData): IMeshData

Combines the current mesh data with another mesh data instance.

Link copied to clipboard
open override fun toMeshData(): MeshData

Converts the current mesh data into an immutable MeshData instance.

Link copied to clipboard
open override fun toMutableMeshData(): MutableMeshData

Converts the current mesh data into a mutable representation.

Link copied to clipboard
open override fun toPolygons(): List<Polygon>

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
open override fun triangulate(): MutableMeshData

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.