Struct gltf::Gltf
[−]
[src]
pub struct Gltf {
pub accessors: Map<String, Accessor>,
pub buffers: Map<String, Buffer>,
pub buffer_views: Map<String, BufferView>,
pub materials: Map<String, Material>,
pub meshes: Map<String, Mesh>,
pub programs: Map<String, Program>,
pub shaders: Map<String, Shader>,
pub techniques: Map<String, Technique>,
}'Raw' glTF data structure that closely matches the structure of a .gltf file
Fields
accessors: Map<String, Accessor>
buffers: Map<String, Buffer>
buffer_views: Map<String, BufferView>
materials: Map<String, Material>
meshes: Map<String, Mesh>
programs: Map<String, Program>
shaders: Map<String, Shader>
techniques: Map<String, 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::new("foo.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:
use gltf::{BufferView, Gltf}; let gltf = Gltf::new("foo.gltf").unwrap(); let buffer_view = gltf .find::<BufferView>("bufferView-123") .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 with the given type and identifer
impl Find<Buffer> for Gltf[src]
fn find(&self, id: &str) -> Option<&Buffer>
Attempts to find the object with the given type and identifer
impl Find<BufferView> for Gltf[src]
fn find(&self, id: &str) -> Option<&BufferView>
Attempts to find the object with the given type and identifer
impl Find<Material> for Gltf[src]
fn find(&self, id: &str) -> Option<&Material>
Attempts to find the object with the given type and identifer
impl Find<Mesh> for Gltf[src]
fn find(&self, id: &str) -> Option<&Mesh>
Attempts to find the object with the given type and identifer
impl Find<Program> for Gltf[src]
fn find(&self, id: &str) -> Option<&Program>
Attempts to find the object with the given type and identifer
impl Find<Shader> for Gltf[src]
fn find(&self, id: &str) -> Option<&Shader>
Attempts to find the object with the given type and identifer