#[repr(C)]
pub struct GltfAsset<'a, ImageData = (Vec<u8>, Extent2D)> { pub gltf: Gltf, pub bin: Cow<'a, [u8]>, pub buffers: Vec<Vec<u8>>, pub images: Vec<ImageData>, }
Expand description

A parsed glTF 2.0 asset and resources. See: https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html

Fields

gltf: Gltf

glTF model

bin: Cow<'a, [u8]>

Binary chunk for GLB

buffers: Vec<Vec<u8>>

Buffer data

images: Vec<ImageData>

Image data

Implementations

Converts to owned data. Clones the binary data if it is not already owned.

Parses a binary glTF.

Parses a glTF JSON string.

Loads a glTF or GLB asset, optionally with its referenced resources.

Loads all resources of this glTF asset. The bin chunk, if exists, will be consumed and left empty.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.