Struct Gltf
pub struct Gltf {
pub document: Document,
pub blob: Option<Vec<u8>>,
}Expand description
glTF JSON wrapper plus binary payload.
Fields§
§document: DocumentThe glTF JSON wrapper.
blob: Option<Vec<u8>>The glTF binary payload in the case of binary glTF.
Implementations§
§impl Gltf
impl Gltf
pub fn open<P>(path: P) -> Result<Gltf, Error>
pub fn open<P>(path: P) -> Result<Gltf, Error>
Convenience function that loads glTF from the file system.
pub fn from_reader_without_validation<R>(reader: R) -> Result<Gltf, Error>
pub fn from_reader_without_validation<R>(reader: R) -> Result<Gltf, Error>
Loads glTF from a reader without performing validation checks.
pub fn from_reader<R>(reader: R) -> Result<Gltf, Error>
pub fn from_reader<R>(reader: R) -> Result<Gltf, Error>
Loads glTF from a reader.
pub fn from_slice_without_validation(slice: &[u8]) -> Result<Gltf, Error>
pub fn from_slice_without_validation(slice: &[u8]) -> Result<Gltf, Error>
Loads glTF from a slice of bytes without performing validation checks.
pub fn from_slice(slice: &[u8]) -> Result<Gltf, Error>
pub fn from_slice(slice: &[u8]) -> Result<Gltf, Error>
Loads glTF from a slice of bytes.
Methods from Deref<Target = Document>§
pub fn as_json(&self) -> &Root
pub fn as_json(&self) -> &Root
Unwraps the glTF document, without consuming it.
pub fn accessors(&self) -> Accessors<'_>
pub fn accessors(&self) -> Accessors<'_>
Returns an Iterator that visits the accessors of the glTF asset.
pub fn animations(&self) -> Animations<'_>
pub fn animations(&self) -> Animations<'_>
Returns an Iterator that visits the animations of the glTF asset.
pub fn buffers(&self) -> Buffers<'_>
pub fn buffers(&self) -> Buffers<'_>
Returns an Iterator that visits the pre-loaded buffers of the glTF asset.
pub fn cameras(&self) -> Cameras<'_>
pub fn cameras(&self) -> Cameras<'_>
Returns an Iterator that visits the cameras of the glTF asset.
pub fn default_scene(&self) -> Option<Scene<'_>>
pub fn default_scene(&self) -> Option<Scene<'_>>
Returns the default scene, if provided.
pub fn extensions_used(&self) -> ExtensionsUsed<'_>
pub fn extensions_used(&self) -> ExtensionsUsed<'_>
Returns the extensions referenced in this .document file.
pub fn extensions_required(&self) -> ExtensionsRequired<'_>
pub fn extensions_required(&self) -> ExtensionsRequired<'_>
Returns the extensions required to load and render this asset.
pub fn images(&self) -> Images<'_>
pub fn images(&self) -> Images<'_>
Returns an Iterator that visits the pre-loaded images of the glTF asset.
pub fn materials(&self) -> Materials<'_>
pub fn materials(&self) -> Materials<'_>
Returns an Iterator that visits the materials of the glTF asset.
pub fn meshes(&self) -> Meshes<'_>
pub fn meshes(&self) -> Meshes<'_>
Returns an Iterator that visits the meshes of the glTF asset.
pub fn nodes(&self) -> Nodes<'_>
pub fn nodes(&self) -> Nodes<'_>
Returns an Iterator that visits the nodes of the glTF asset.
pub fn samplers(&self) -> Samplers<'_>
pub fn samplers(&self) -> Samplers<'_>
Returns an Iterator that visits the samplers of the glTF asset.
pub fn scenes(&self) -> Scenes<'_>
pub fn scenes(&self) -> Scenes<'_>
Returns an Iterator that visits the scenes of the glTF asset.
pub fn skins(&self) -> Skins<'_>
pub fn skins(&self) -> Skins<'_>
Returns an Iterator that visits the skins of the glTF asset.
pub fn textures(&self) -> Textures<'_>
pub fn textures(&self) -> Textures<'_>
Returns an Iterator that visits the textures of the glTF asset.
pub fn views(&self) -> Views<'_>
pub fn views(&self) -> Views<'_>
Returns an Iterator that visits the pre-loaded buffer views of the glTF
asset.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Gltf
impl RefUnwindSafe for Gltf
impl Send for Gltf
impl Sync for Gltf
impl Unpin for Gltf
impl UnsafeUnpin for Gltf
impl UnwindSafe for Gltf
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.