GLTF2

@Serializable
data class GLTF2(var name: String? = null, val asset: GLTF2.Asset = Asset(), val extensionsUsed: List<String> = emptyList(), val extensionsRequired: List<String> = emptyList(), val scene: Int = -1, val images: List<GLTF2.Image> = emptyList(), val textures: List<GLTF2.Texture> = emptyList(), val scenes: List<GLTF2.Scene> = emptyList(), val nodes: List<GLTF2.Node> = emptyList(), val meshes: List<GLTF2.Mesh> = emptyList(), val skins: List<GLTF2.Skin> = emptyList(), val animations: List<GLTF2.Animation> = emptyList(), val buffers: List<GLTF2.Buffer> = emptyList(), val bufferViews: List<GLTF2.BufferView> = emptyList(), val accessors: List<GLTF2.Accessor> = emptyList(), val materials: List<GLTF2.Material> = emptyList(), val samplers: List<GLTF2.Sampler> = emptyList(), val cameras: List<GLTF2.Camera> = emptyList(), val extensions: JsonElement? = null, val extras: JsonElement? = null) : GLTFProperty, GLTF2Holder

Constructors

Link copied to clipboard
constructor(name: String? = null, asset: GLTF2.Asset = Asset(), extensionsUsed: List<String> = emptyList(), extensionsRequired: List<String> = emptyList(), scene: Int = -1, images: List<GLTF2.Image> = emptyList(), textures: List<GLTF2.Texture> = emptyList(), scenes: List<GLTF2.Scene> = emptyList(), nodes: List<GLTF2.Node> = emptyList(), meshes: List<GLTF2.Mesh> = emptyList(), skins: List<GLTF2.Skin> = emptyList(), animations: List<GLTF2.Animation> = emptyList(), buffers: List<GLTF2.Buffer> = emptyList(), bufferViews: List<GLTF2.BufferView> = emptyList(), accessors: List<GLTF2.Accessor> = emptyList(), materials: List<GLTF2.Material> = emptyList(), samplers: List<GLTF2.Sampler> = emptyList(), cameras: List<GLTF2.Camera> = emptyList(), extensions: JsonElement? = null, extras: JsonElement? = null)

Types

Link copied to clipboard
@Serializable
data class Accessor(var name: String? = null, val bufferView: Int = 0, val byteOffset: Int = 0, val componentType: Int = 0, val normalized: Boolean = false, val count: Int = 1, val min: FloatArray = FloatArray(0), val max: FloatArray = FloatArray(0), val type: GLTF2.AccessorType = AccessorType.SCALAR, val sparse: JsonElement? = null, val extensions: JsonElement? = null, val extras: JsonElement? = null) : GLTFProperty
Link copied to clipboard
@Serializable
enum AccessorType : Enum<GLTF2.AccessorType>
Link copied to clipboard
@Serializable
data class Animation(var name: String? = null, val channels: List<GLTF2.Animation.Channel> = emptyList(), val samplers: List<GLTF2.Animation.Sampler> = emptyList(), val extensions: JsonElement? = null, val extras: JsonElement? = null) : GLTFProperty
Link copied to clipboard
@Serializable
data class Asset(var name: String? = null, val version: String = "2.0", val generator: String? = null, val copyright: String? = null, val minVersion: String? = null, val extensions: JsonElement? = null, val extras: JsonElement? = null) : GLTFProperty
Link copied to clipboard
@Serializable
data class Buffer(var name: String? = null, val uri: String? = null, val byteLength: Int = 0, val extensions: JsonElement? = null, val extras: JsonElement? = null) : GLTFProperty

A buffer points to binary geometry, animation, or skins.

Link copied to clipboard
@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.

Link copied to clipboard
@Serializable
data class Camera(var name: String? = null, val type: String, val perspective: GLTF2.Camera.Perspective? = null, val orthographic: GLTF2.Camera.Orthographic? = null, val extensions: JsonElement? = null, val extras: JsonElement? = null) : GLTFProperty
Link copied to clipboard
object Companion
Link copied to clipboard
@Serializable
data class Image(var name: String? = null, val uri: String? = null, val bufferView: Int = -1, val mimeType: String? = null, val extensions: JsonElement? = null, val extras: JsonElement? = null) : GLTFProperty
Link copied to clipboard
@Serializable
data class Material(var name: String? = null, val alphaMode: String? = null, val alphaCutoff: Float = 0.5f, val doubleSided: Boolean = true, val emissiveFactor: FloatArray? = null, val emissiveTexture: GLTF2.Material.TextureInfo? = null, val pbrMetallicRoughness: GLTF2.Material.PBRMetallicRoughness? = null, val normalTexture: GLTF2.Material.NormalTextureInfo? = null, val occlusionTexture: GLTF2.Material.OcclusionTextureInfo? = null, val extensions: JsonElement? = null, val extras: JsonElement? = null) : GLTFProperty

The material appearance of a primitive.

Link copied to clipboard
@Serializable
data class Mesh(var name: String? = null, val primitives: List<GLTF2.Primitive> = emptyList(), val weights: FloatArray? = null, val extensions: JsonElement? = null, val extras: JsonElement? = null) : GLTFProperty
Link copied to clipboard
@Serializable
data class Node(var name: String? = null, val camera: Int = -1, val skin: Int = -1, val mesh: Int? = null, val children: IntArray = intArrayOf(), val scale: FloatArray? = null, val translation: FloatArray? = null, val rotation: FloatArray? = null, val matrix: FloatArray? = null, val weights: IntArray? = null, val extensions: JsonElement? = null, val extras: JsonElement? = null) : GLTFProperty
Link copied to clipboard
@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
Link copied to clipboard
@Serializable
value class PrimitiveAttribute(val str: String)
Link copied to clipboard
data class ReadOptions(val ignoreUnknownKeys: Boolean = false)
Link copied to clipboard
@Serializable
data class Sampler(var name: String? = null, val magFilter: Int? = null, val minFilter: Int? = null, val wrapS: Int? = null, val wrapT: Int? = null, val extensions: JsonElement? = null, val extras: JsonElement? = null) : GLTFProperty
Link copied to clipboard
@Serializable
data class Scene(var name: String? = null, val nodes: IntArray = intArrayOf(), val extensions: JsonElement? = null, val extras: JsonElement? = null) : GLTFProperty
Link copied to clipboard
@Serializable
data class Skin(var name: String? = null, val inverseBindMatrices: Int? = null, val joints: IntArray = IntArray(0), val skeleton: Int? = null, val extensions: JsonElement? = null, val extras: JsonElement? = null) : GLTFProperty
Link copied to clipboard
@Serializable
data class Texture(var name: String? = null, val sampler: Int? = null, val source: Int = -1, val extensions: JsonElement? = null, val extras: JsonElement? = null) : GLTFProperty

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
Link copied to clipboard
open override val extensions: JsonElement? = null

JSON object with extension-specific objects.

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

Functions

Link copied to clipboard
fun resolveUri(file: VfsFile?, uri: String): VfsFile?