Struct gltf::Gltf
[−]
[src]
pub struct Gltf { pub accessors: Map<Id, Accessor>, pub asset: Asset, pub buffers: Map<Id, Buffer>, pub buffer_views: Map<Id, BufferView>, pub materials: Map<Id, Material>, pub meshes: Map<Id, Mesh>, pub programs: Map<Id, Program>, pub shaders: Map<Id, Shader>, pub techniques: Map<Id, Technique>, }
Fields
accessors: Map<Id, Accessor>
asset: Asset
buffers: Map<Id, Buffer>
buffer_views: Map<Id, BufferView>
materials: Map<Id, Material>
meshes: Map<Id, Mesh>
programs: Map<Id, Program>
shaders: Map<Id, Shader>
techniques: Map<Id, Technique>
Methods
impl Gltf
[src]
fn new<P: AsRef<Path>>(path: P) -> Result<Self, Error>
Loads a glTF asset
Examples
Basic usage:
let gltf = gltf::Gltf::new("./examples/box/Box.gltf") .expect("Error loading glTF asset");
fn find<T>(&self, id: &str) -> Option<&T> where Self: Find<T>
Looks up a top-level object by its identifier
Examples
Finding a buffer view:
let gltf = gltf::Gltf::new("./examples/box/Box.gltf").unwrap(); let buffer_view = gltf .find::<gltf::BufferView>("bufferView_29") .expect("Buffer view not found");
Trait Implementations
impl Debug for Gltf
[src]
impl Find<Accessor> for Gltf
[src]
fn find(&self, id: &str) -> Option<&Accessor>
Attempts to find the object of type T
with identifer id
impl Find<Buffer> for Gltf
[src]
impl Find<BufferView> for Gltf
[src]
fn find(&self, id: &str) -> Option<&BufferView>
Attempts to find the object of type T
with identifer id
impl Find<Material> for Gltf
[src]
fn find(&self, id: &str) -> Option<&Material>
Attempts to find the object of type T
with identifer id
impl Find<Mesh> for Gltf
[src]
impl Find<Program> for Gltf
[src]
fn find(&self, id: &str) -> Option<&Program>
Attempts to find the object of type T
with identifer id