MeshDataBuilder

class MeshDataBuilder

A builder for MeshData.

Constructors

MeshDataBuilder
Link copied to clipboard
fun MeshDataBuilder()

Types

Companion
Link copied to clipboard
object Companion
FaceVertex
Link copied to clipboard
data class FaceVertex(positionIndex: Int, texCoordIndex: Int, normalIndex: Int)

Indices for a single face vertex.

Functions

addFace
Link copied to clipboard
fun addFace(indices: List<MeshDataBuilder.FaceVertex>): MeshDataBuilder

Adds another face to the mesh.

addNormal
Link copied to clipboard
fun addNormal(normal: Vec3): MeshDataBuilder

Adds another normal vector to the mesh.

fun addNormal(coordinates: List<Float>): MeshDataBuilder

Adds another normal vector to the mesh.

addTextureCoordinates
Link copied to clipboard
fun addTextureCoordinates(coordinates: Vec2): MeshDataBuilder

Adds another texture coordinates to the mesh.

fun addTextureCoordinates(coordinates: List<Float>): MeshDataBuilder

Adds another texture coordinates to the mesh.

addVertex
Link copied to clipboard
fun addVertex(vertexPos: Vec3): MeshDataBuilder

Adds another vertex position to the mesh.

fun addVertex(coordinates: List<Float>): MeshDataBuilder

Adds another vertex position to the mesh.

buildArrayMeshData
Link copied to clipboard
fun buildArrayMeshData(): ArrayMeshData

Builds a container for the array buffers data related to a single mesh, without indices.