BufferView

@Serializable
data class BufferView(var name: String? = null, val buffer: Int = -1, val byteOffset: Int = 0, val byteLength: Int = 0, val byteStride: Int = 0, val target: Int = -1, val extensions: JsonElement? = null, val extras: JsonElement? = null) : GLTFProperty

A view into a buffer generally representing a subset of the buffer.

https://github.com/KhronosGroup/glTF/blob/main/specification/2.0/schema/bufferView.schema.json

Constructors

Link copied to clipboard
constructor(name: String? = null, buffer: Int = -1, byteOffset: Int = 0, byteLength: Int = 0, byteStride: Int = 0, target: Int = -1, extensions: JsonElement? = null, extras: JsonElement? = null)

Properties

Link copied to clipboard
val buffer: Int

The index of the buffer.

Link copied to clipboard
val byteLength: Int = 0

The length of the bufferView in bytes.

Link copied to clipboard
val byteOffset: Int = 0

The offset into the buffer in bytes.

Link copied to clipboard
val byteStride: Int = 0

The stride, in bytes, between vertex attributes. When this is not defined, data is tightly packed. When two or more accessors use the same buffer view, this field MUST be defined.

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
open override var name: String?
Link copied to clipboard
val target: Int

The hint representing the intended GPU buffer type to use with this buffer view.

Functions

Link copied to clipboard
fun slice(gltf: GLTF2): Buffer