MeshBuilder

class MeshBuilder(val geometry: MeshGeometry)

A helper class to build common geometry within an MeshGeometry.

Based off: https://github.com/fabmax/kool/blob/main/kool-core/src/commonMain/kotlin/de/fabmax/kool/scene/geometry/MeshBuilder.kt

Parameters

geometry

the list to build the geometry to.

Constructors

Link copied to clipboard
fun MeshBuilder(geometry: MeshGeometry)

Types

Link copied to clipboard
class CubeProps
Link copied to clipboard
class GridProps

Functions

Link copied to clipboard
fun addTriIndices(i0: Int, i1: Int, i2: Int)
Link copied to clipboard
fun clear()
Link copied to clipboard

Generates a cube geometry.

inline fun cube(block: MeshBuilder.CubeProps.() -> Unit)
Link copied to clipboard
inline fun grid(block: MeshBuilder.GridProps.() -> Unit)

Generates a grid geometry.

Link copied to clipboard
fun identity(): Mat4
Link copied to clipboard
fun rotate(angle: Angle, axis: Vec3f): Mat4
fun rotate(eulerX: Angle, eulerY: Angle, eulerZ: Angle): Mat4
fun rotate(angle: Angle, axX: Float, axY: Float, axZ: Float): Mat4
Link copied to clipboard
fun scale(s: Float): Mat4
fun scale(x: Float, y: Float, z: Float): Mat4
Link copied to clipboard
fun translate(x: Float, y: Float, z: Float): Mat4
Link copied to clipboard
inline fun vertex(block: VertexView.() -> Unit): Int

Add a vertex to the geometry.

fun vertex(pos: Vec3f, nrm: Vec3f, uv: Vec2f = Vec2f.ZERO): Int

Sets the vertex directly to the geometry.

Link copied to clipboard
inline fun withColor(color: Color, block: MeshBuilder.() -> Unit)
Link copied to clipboard
inline fun withTransform(block: MeshBuilder.() -> Unit)

Pushes a transform and then pops outside the block.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var vertexModFun: VertexView.() -> Unit? = null