Primitive

@Serializable
data class Primitive(var name: String? = null, val attributes: Map<GLTF2.PrimitiveAttribute, Int> = emptyMap(), val indices: Int? = null, val material: Int? = null, val mode: Int = 4, val targets: List<Map<GLTF2.PrimitiveAttribute, Int>> = emptyList(), val extensions: JsonElement? = null, val extras: JsonElement? = null) : GLTFProperty

Constructors

Link copied to clipboard
constructor(name: String? = null, attributes: Map<GLTF2.PrimitiveAttribute, Int> = emptyMap(), indices: Int? = null, material: Int? = null, mode: Int = 4, targets: List<Map<GLTF2.PrimitiveAttribute, Int>> = emptyList(), extensions: JsonElement? = null, extras: JsonElement? = null)

Properties

Link copied to clipboard

A plain JSON object, where each key corresponds to a mesh attribute semantic and each value is the index of the accessor containing attribute's data.

Link copied to clipboard
open override val extensions: JsonElement? = null

JSON object with extension-specific objects.

Link copied to clipboard
open override val extras: JsonElement? = null

Although extras MAY have any type, it is common for applications to store and access custom data as key/value pairs. Therefore, extras SHOULD be a JSON object rather than a primitive value for best portability.

Link copied to clipboard
val indices: Int? = null

The index of the accessor that contains the vertex indices. When this is undefined, the primitive defines non-indexed geometry. When defined, the accessor MUST have SCALAR type and an unsigned integer component type.

Link copied to clipboard
val material: Int? = null

The index of the material to apply to this primitive when rendering.

Link copied to clipboard
val mode: Int = 4

The topology type of primitives to render.

Link copied to clipboard
open override var name: String?
Link copied to clipboard

An array of morph targets. Morph targets: one per morphing weight. Typically, 4 as max for standard. A plain JSON object specifying attributes displacements in a morph target, where each key corresponds to one of the three supported attribute semantic (POSITION, NORMAL, or TANGENT) and each value is the index of the accessor containing the attribute displacements' data.

Functions

Link copied to clipboard
fun getBounds(gltf: GLTF2): AABB3D