pub struct Gltf {
pub document: Document,
pub blob: Option<Vec<u8>>,
}
Expand description
glTF JSON wrapper plus binary payload.
Fields§
§document: Document
The glTF JSON wrapper.
blob: Option<Vec<u8>>
The glTF binary payload in the case of binary glTF.
Implementations§
source§impl Gltf
impl Gltf
sourcepub fn open<P>(path: P) -> Result<Self>
pub fn open<P>(path: P) -> Result<Self>
Convenience function that loads glTF from the file system.
sourcepub fn from_reader_without_validation<R>(reader: R) -> Result<Self>
pub fn from_reader_without_validation<R>(reader: R) -> Result<Self>
Loads glTF from a reader without performing validation checks.
sourcepub fn from_reader<R>(reader: R) -> Result<Self>
pub fn from_reader<R>(reader: R) -> Result<Self>
Loads glTF from a reader.
sourcepub fn from_slice_without_validation(slice: &[u8]) -> Result<Self>
pub fn from_slice_without_validation(slice: &[u8]) -> Result<Self>
Loads glTF from a slice of bytes without performing validation checks.
sourcepub fn from_slice(slice: &[u8]) -> Result<Self>
pub fn from_slice(slice: &[u8]) -> Result<Self>
Loads glTF from a slice of bytes.
Methods from Deref<Target = Document>§
sourcepub fn accessors(&self) -> Accessors<'_> ⓘ
pub fn accessors(&self) -> Accessors<'_> ⓘ
Returns an Iterator
that visits the accessors of the glTF asset.
sourcepub fn animations(&self) -> Animations<'_> ⓘ
pub fn animations(&self) -> Animations<'_> ⓘ
Returns an Iterator
that visits the animations of the glTF asset.
sourcepub fn buffers(&self) -> Buffers<'_> ⓘ
pub fn buffers(&self) -> Buffers<'_> ⓘ
Returns an Iterator
that visits the pre-loaded buffers of the glTF asset.
sourcepub fn cameras(&self) -> Cameras<'_> ⓘ
pub fn cameras(&self) -> Cameras<'_> ⓘ
Returns an Iterator
that visits the cameras of the glTF asset.
sourcepub fn default_scene(&self) -> Option<Scene<'_>>
pub fn default_scene(&self) -> Option<Scene<'_>>
Returns the default scene, if provided.
sourcepub fn extensions_used(&self) -> ExtensionsUsed<'_> ⓘ
pub fn extensions_used(&self) -> ExtensionsUsed<'_> ⓘ
Returns the extensions referenced in this .document file.
sourcepub fn extensions_required(&self) -> ExtensionsRequired<'_> ⓘ
pub fn extensions_required(&self) -> ExtensionsRequired<'_> ⓘ
Returns the extensions required to load and render this asset.
sourcepub fn images(&self) -> Images<'_> ⓘ
pub fn images(&self) -> Images<'_> ⓘ
Returns an Iterator
that visits the pre-loaded images of the glTF asset.
sourcepub fn extensions(&self) -> Option<&Map<String, Value>>
pub fn extensions(&self) -> Option<&Map<String, Value>>
Returns extension data unknown to this crate version.
sourcepub fn extension_value(&self, ext_name: &str) -> Option<&Value>
pub fn extension_value(&self, ext_name: &str) -> Option<&Value>
Queries extension data unknown to this crate version.
sourcepub fn lights(&self) -> Option<Lights<'_>>
pub fn lights(&self) -> Option<Lights<'_>>
Returns an Iterator
that visits the lights of the glTF asset as defined by the
KHR_lights_punctual
extension.
sourcepub fn materials(&self) -> Materials<'_> ⓘ
pub fn materials(&self) -> Materials<'_> ⓘ
Returns an Iterator
that visits the materials of the glTF asset.
sourcepub fn meshes(&self) -> Meshes<'_> ⓘ
pub fn meshes(&self) -> Meshes<'_> ⓘ
Returns an Iterator
that visits the meshes of the glTF asset.
sourcepub fn nodes(&self) -> Nodes<'_> ⓘ
pub fn nodes(&self) -> Nodes<'_> ⓘ
Returns an Iterator
that visits the nodes of the glTF asset.
sourcepub fn samplers(&self) -> Samplers<'_> ⓘ
pub fn samplers(&self) -> Samplers<'_> ⓘ
Returns an Iterator
that visits the samplers of the glTF asset.
sourcepub fn scenes(&self) -> Scenes<'_> ⓘ
pub fn scenes(&self) -> Scenes<'_> ⓘ
Returns an Iterator
that visits the scenes of the glTF asset.
sourcepub fn skins(&self) -> Skins<'_> ⓘ
pub fn skins(&self) -> Skins<'_> ⓘ
Returns an Iterator
that visits the skins of the glTF asset.