Expand description
A minimal crate for loading glTF.
This crate is auto-generated from the specification’s Json Schema, so some comments may not exactly match the Rust names.
Structs§
- Accessor
- A typed view into a bufferView. A bufferView contains raw binary data. An accessor provides a typed view into a bufferView or a subset of a bufferView similar to how WebGL’s
vertexAttribPointer()
defines an attribute in a buffer. - Accessor
Sparse - Sparse storage of attributes that deviate from their initialization value.
- Accessor
Sparse Indices - Index array of size
count
that points to those accessor attributes that deviate from their initialization value. Indices must strictly increase. - Accessor
Sparse Values - Array of size
count
times number of components, storing the displaced accessor attributes pointed byindices
. Substituted values must have the samecomponentType
and number of components as the base accessor. - Animation
- A keyframe animation.
- Animation
Channel - Targets an animation’s sampler at a node’s property.
- Animation
Channel Target - The index of the node and TRS property to target.
- Animation
Sampler - Combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target).
- Asset
- Metadata about the glTF asset.
- Buffer
- A buffer points to binary geometry, animation, or skins.
- Buffer
View - A view into a buffer generally representing a subset of the buffer.
- Camera
- A camera’s projection. A node can reference a camera to apply a transform to place the camera in the scene.
- Camera
Orthographic - An orthographic camera containing properties to create an orthographic projection matrix.
- Camera
Perspective - A perspective camera containing properties to create a perspective projection matrix.
- Extension
- Dictionary object with extension-specific objects.
- GLB
- A GLTF with all of its data included within a buffer.
- GlTf
- The root object for a glTF asset.
- Image
- Image data used to create a texture. Image can be referenced by URI or
bufferView
index.mimeType
is required in the latter case. - Material
- The material appearance of a primitive.
- Material
Normal Texture Info - The normal map texture.
- Material
Occlusion Texture Info - The occlusion map texture.
- Material
PbrMetallic Roughness - A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology. When not specified, all the default values of
pbrMetallicRoughness
apply. - Mesh
- A set of primitives to be rendered. A node can contain one mesh. A node’s transform places the mesh in the scene.
- Mesh
Primitive - Geometry to be rendered with the given material.
- Node
- A node in the node hierarchy. When the node contains
skin
, allmesh.primitives
must containJOINTS_0
andWEIGHTS_0
attributes. A node can have either amatrix
or any combination oftranslation
/rotation
/scale
(TRS) properties. TRS properties are converted to matrices and postmultiplied in theT * R * S
order to compose the transformation matrix; first the scale is applied to the vertices, then the rotation, and then the translation. If none are provided, the transform is the identity. When a node is targeted for animation (referenced by an animation.channel.target), only TRS properties may be present;matrix
will not be present. - Sampler
- Texture sampler properties for filtering and wrapping modes.
- Scene
- The root nodes of a scene.
- Skin
- Joints and matrices defining a skin.
- Texture
- A texture and its sampler.
- Texture
Info - The base color texture.
Enums§
- Accessor
Component Type - The datatype of components in the attribute.
- Accessor
Sparse Indices Component Type - The indices data type.
- Accessor
Type - Specifies if the attribute is a scalar, vector, or matrix.
- Animation
Channel Target Path - The name of the node’s TRS property to modify, or the “weights” of the Morph Targets it instantiates. For the “translation” property, the values that are provided by the sampler are the translation along the x, y, and z axes. For the “rotation” property, the values are a quaternion in the order (x, y, z, w), where w is the scalar. For the “scale” property, the values are the scaling factors along the x, y, and z axes.
- Animation
Sampler Interpolation - Interpolation algorithm.
- Buffer
View Target - The target that the GPU buffer should be bound to.
- Camera
Type - Specifies if the camera uses a perspective or orthographic projection.
- GLBError
- Image
Mime Type - The image’s MIME type. Required if
bufferView
is defined. - Material
Alpha Mode - The alpha rendering mode of the material.
- Mesh
Primitive Mode - The type of primitives to render.
- Sampler
MagFilter - Magnification filter.
- Sampler
MinFilter - Minification filter.
- Sampler
WrapS - s wrapping mode.
- Sampler
WrapT - t wrapping mode.