Element

data class Element(val from: Vector3dc, val to: Vector3dc, val rotation: Model.Element.Rotation?, val faces: Map<Model.Direction, Model.Element.Face>, val shade: Boolean)

A voxel of a Model.

Parameters

from

The start position of the voxel.

to

The end position of the voxel.

rotation

The rotation of the voxel.

faces

A map of the voxel's faces.

Constructors

Link copied to clipboard
constructor(from: Vector3dc, to: Vector3dc, rotation: Model.Element.Rotation?, faces: Map<Model.Direction, Model.Element.Face>, shade: Boolean)

Types

Link copied to clipboard
data class Face(val uv: Vector4dc?, val texture: String, val cullface: Model.Direction?, val rotation: Int, val tintIndex: Int)

A face of an Element.

Link copied to clipboard
data class Rotation(val angle: Double, val axis: Model.Axis, val origin: Vector3dc, val rescale: Boolean)

The rotation of an Element.

Properties

Link copied to clipboard
Link copied to clipboard
val from: Vector3dc
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val to: Vector3dc

Functions

Link copied to clipboard
fun generateUV(direction: Model.Direction): Vector4dc

Generates the UV coordinates for a face based the position of this Element for the given direction. This results in the same UV coordinates as those that are automatically generated by the client for faces that do not specify UV coordinates.