[go: up one dir, main page]

Struct gltf::Gltf[][src]

pub struct Gltf {
    pub document: Document,
    pub blob: Option<Vec<u8>>,
}
Expand description

glTF JSON wrapper plus binary payload.

Fields

document: Document
Expand description

The glTF JSON wrapper.

blob: Option<Vec<u8>>
Expand description

The glTF binary payload in the case of binary glTF.

Implementations

impl Gltf[src]

pub fn open<P>(path: P) -> Result<Self> where
    P: AsRef<Path>, 
[src]

Convenience function that loads glTF from the file system.

pub fn from_reader_without_validation<R>(reader: R) -> Result<Self> where
    R: Read + Seek
[src]

Loads glTF from a reader without performing validation checks.

pub fn from_reader<R>(reader: R) -> Result<Self> where
    R: Read + Seek
[src]

Loads glTF from a reader.

pub fn from_slice_without_validation(slice: &[u8]) -> Result<Self>[src]

Loads glTF from a slice of bytes without performing validation checks.

pub fn from_slice(slice: &[u8]) -> Result<Self>[src]

Loads glTF from a slice of bytes.

Methods from Deref<Target = Document>

pub fn accessors(&self) -> Accessors<'_>

Notable traits for Accessors<'a>

impl<'a> Iterator for Accessors<'a> type Item = Accessor<'a>;
[src]

Returns an Iterator that visits the accessors of the glTF asset.

pub fn animations(&self) -> Animations<'_>

Notable traits for Animations<'a>

impl<'a> Iterator for Animations<'a> type Item = Animation<'a>;
[src]

Returns an Iterator that visits the animations of the glTF asset.

pub fn buffers(&self) -> Buffers<'_>

Notable traits for Buffers<'a>

impl<'a> Iterator for Buffers<'a> type Item = Buffer<'a>;
[src]

Returns an Iterator that visits the pre-loaded buffers of the glTF asset.

pub fn cameras(&self) -> Cameras<'_>

Notable traits for Cameras<'a>

impl<'a> Iterator for Cameras<'a> type Item = Camera<'a>;
[src]

Returns an Iterator that visits the cameras of the glTF asset.

pub fn default_scene(&self) -> Option<Scene<'_>>[src]

Returns the default scene, if provided.

pub fn extensions_used(&self) -> ExtensionsUsed<'_>

Notable traits for ExtensionsUsed<'a>

impl<'a> Iterator for ExtensionsUsed<'a> type Item = &'a str;
[src]

Returns the extensions referenced in this .document file.

pub fn extensions_required(&self) -> ExtensionsRequired<'_>

Notable traits for ExtensionsRequired<'a>

impl<'a> Iterator for ExtensionsRequired<'a> type Item = &'a str;
[src]

Returns the extensions required to load and render this asset.

pub fn images(&self) -> Images<'_>

Notable traits for Images<'a>

impl<'a> Iterator for Images<'a> type Item = Image<'a>;
[src]

Returns an Iterator that visits the pre-loaded images of the glTF asset.

pub fn lights(&self) -> Option<Lights<'_>>[src]

This is supported on crate feature KHR_lights_punctual only.

Returns an Iterator that visits the lights of the glTF asset as defined by the KHR_lights_punctual extension.

pub fn materials(&self) -> Materials<'_>

Notable traits for Materials<'a>

impl<'a> Iterator for Materials<'a> type Item = Material<'a>;
[src]

Returns an Iterator that visits the materials of the glTF asset.

pub fn meshes(&self) -> Meshes<'_>

Notable traits for Meshes<'a>

impl<'a> Iterator for Meshes<'a> type Item = Mesh<'a>;
[src]

Returns an Iterator that visits the meshes of the glTF asset.

pub fn nodes(&self) -> Nodes<'_>

Notable traits for Nodes<'a>

impl<'a> Iterator for Nodes<'a> type Item = Node<'a>;
[src]

Returns an Iterator that visits the nodes of the glTF asset.

pub fn samplers(&self) -> Samplers<'_>

Notable traits for Samplers<'a>

impl<'a> Iterator for Samplers<'a> type Item = Sampler<'a>;
[src]

Returns an Iterator that visits the samplers of the glTF asset.

pub fn scenes(&self) -> Scenes<'_>

Notable traits for Scenes<'a>

impl<'a> Iterator for Scenes<'a> type Item = Scene<'a>;
[src]

Returns an Iterator that visits the scenes of the glTF asset.

pub fn skins(&self) -> Skins<'_>

Notable traits for Skins<'a>

impl<'a> Iterator for Skins<'a> type Item = Skin<'a>;
[src]

Returns an Iterator that visits the skins of the glTF asset.

pub fn textures(&self) -> Textures<'_>

Notable traits for Textures<'a>

impl<'a> Iterator for Textures<'a> type Item = Texture<'a>;
[src]

Returns an Iterator that visits the textures of the glTF asset.

pub fn views(&self) -> Views<'_>

Notable traits for Views<'a>

impl<'a> Iterator for Views<'a> type Item = View<'a>;
[src]

Returns an Iterator that visits the pre-loaded buffer views of the glTF asset.

Trait Implementations

impl Clone for Gltf[src]

fn clone(&self) -> Gltf[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Gltf[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Deref for Gltf[src]

type Target = Document

The resulting type after dereferencing.

fn deref(&self) -> &Self::Target[src]

Dereferences the value.

impl DerefMut for Gltf[src]

fn deref_mut(&mut self) -> &mut Self::Target[src]

Mutably dereferences the value.

Auto Trait Implementations

impl RefUnwindSafe for Gltf

impl Send for Gltf

impl Sync for Gltf

impl Unpin for Gltf

impl UnwindSafe for Gltf

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointable for T

pub const ALIGN: usize

The alignment of pointer.

type Init = T

The type for initializers.

pub unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more

pub unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more

pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more

pub unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.