Struct gltf::json::root::Root
[−]
[src]
pub struct Root { pub accessors: Vec<Accessor>, pub animations: Vec<Animation>, pub asset: Asset, pub buffers: Vec<Buffer>, pub buffer_views: Vec<View>, pub scene: Option<Index<Scene>>, pub extensions: Root, pub extras: Extras, pub extensions_used: Vec<String>, pub extensions_required: Vec<String>, pub cameras: Vec<Camera>, pub images: Vec<Image>, pub materials: Vec<Material>, pub meshes: Vec<Mesh>, pub nodes: Vec<Node>, pub samplers: Vec<Sampler>, pub scenes: Vec<Scene>, pub skins: Vec<Skin>, pub textures: Vec<Texture>, }
The root object of a glTF 2.0 asset.
Fields
accessors: Vec<Accessor>
An array of accessors.
animations: Vec<Animation>
An array of keyframe animations.
asset: Asset
Metadata about the glTF asset.
buffers: Vec<Buffer>
An array of buffers.
buffer_views: Vec<View>
An array of buffer views.
scene: Option<Index<Scene>>
The default scene.
extensions: Root
Extension specific data.
extras: Extras
Optional application specific data.
extensions_used: Vec<String>
Names of glTF extensions used somewhere in this asset.
extensions_required: Vec<String>
Names of glTF extensions required to properly load this asset.
cameras: Vec<Camera>
An array of cameras.
images: Vec<Image>
An array of images.
materials: Vec<Material>
An array of materials.
meshes: Vec<Mesh>
An array of meshes.
nodes: Vec<Node>
An array of nodes.
samplers: Vec<Sampler>
An array of samplers.
scenes: Vec<Scene>
An array of scenes.
skins: Vec<Skin>
An array of skins.
textures: Vec<Texture>
An array of textures.
Methods
impl Root
[src]
fn accessor(&self, index: Index<Accessor>) -> &Accessor
Returns the accessor at the given index.
fn accessors(&self) -> &[Accessor]
Returns all accessors as a slice.
fn animation(&self, index: Index<Animation>) -> &Animation
Returns the animation at the given index.
fn animations(&self) -> &[Animation]
Returns all animations as a slice.
fn asset(&self) -> &Asset
Returns the metadata included with this asset.
fn buffer(&self, index: Index<Buffer>) -> &Buffer
Returns the buffer at the given index.
fn buffers(&self) -> &[Buffer]
Returns all buffers as a slice.
fn buffer_view(&self, index: Index<View>) -> &View
Returns the buffer view at the given index.
fn buffer_views(&self) -> &[View]
Returns all buffer views as a slice.
fn camera(&self, index: Index<Camera>) -> &Camera
Returns the camera at the given index.
fn cameras(&self) -> &[Camera]
Returns all cameras as a slice.
fn extensions_used(&self) -> &[String]
Returns the extensions referenced in this .gltf file.
fn extensions_required(&self) -> &[String]
Returns the extensions required to load and render this asset.
fn get<T>(&self, index: &Index<T>) -> Option<&T> where
Self: Get<T>,
Self: Get<T>,
Returns a single item from the root object.
fn image(&self, index: Index<Image>) -> &Image
Returns the image at the given index.
fn images(&self) -> &[Image]
Returns all images as a slice.
fn material(&self, index: Index<Material>) -> &Material
Returns the material at the given index.
fn materials(&self) -> &[Material]
Returns all materials as a slice.
fn mesh(&self, index: Index<Mesh>) -> &Mesh
Returns the mesh at the given index.
fn meshes(&self) -> &[Mesh]
Returns all meshes as a slice.
fn node(&self, index: Index<Node>) -> &Node
Returns the node at the given index.
fn nodes(&self) -> &[Node]
Returns all nodes as a slice.
fn sampler(&self, index: Index<Sampler>) -> &Sampler
Returns the sampler at the given index.
fn samplers(&self) -> &[Sampler]
Returns all samplers as a slice.
fn scene(&self, index: Index<Scene>) -> &Scene
Returns the scene at the given index.
fn scenes(&self) -> &[Scene]
Returns all scenes as a slice.
fn skin(&self, index: Index<Skin>) -> &Skin
Returns the skin at the given index.
fn skins(&self) -> &[Skin]
Returns all skins as a slice.
fn texture(&self, index: Index<Texture>) -> &Texture
Returns the texture at the given index.
fn textures(&self) -> &[Texture]
Returns all textures as a slice.
Trait Implementations
impl Clone for Root
[src]
fn clone(&self) -> Root
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Root
[src]
impl Default for Root
[src]
impl Validate for Root
[src]
fn validate_minimally<P, R>(&self, _root: &Root, _path: P, _report: &mut R) where
P: Fn() -> Path,
R: FnMut(&Fn() -> Path, Error),
P: Fn() -> Path,
R: FnMut(&Fn() -> Path, Error),
Validates only the invariants required for the library to function safely.
fn validate_completely<P, R>(&self, _root: &Root, _path: P, _report: &mut R) where
P: Fn() -> Path,
R: FnMut(&Fn() -> Path, Error),
P: Fn() -> Path,
R: FnMut(&Fn() -> Path, Error),
Validates the data against the glTF 2.0 specification.
impl<'a> Get<Accessor> for Root
[src]
fn get(&self, index: &Index<Accessor>) -> Option<&Accessor>
Retrieves a single value at the given index.
impl<'a> Get<Animation> for Root
[src]
fn get(&self, index: &Index<Animation>) -> Option<&Animation>
Retrieves a single value at the given index.
impl<'a> Get<Buffer> for Root
[src]
fn get(&self, index: &Index<Buffer>) -> Option<&Buffer>
Retrieves a single value at the given index.
impl<'a> Get<View> for Root
[src]
impl<'a> Get<Camera> for Root
[src]
fn get(&self, index: &Index<Camera>) -> Option<&Camera>
Retrieves a single value at the given index.
impl<'a> Get<Image> for Root
[src]
impl<'a> Get<Material> for Root
[src]
fn get(&self, index: &Index<Material>) -> Option<&Material>
Retrieves a single value at the given index.
impl<'a> Get<Mesh> for Root
[src]
impl<'a> Get<Node> for Root
[src]
impl<'a> Get<Sampler> for Root
[src]
fn get(&self, index: &Index<Sampler>) -> Option<&Sampler>
Retrieves a single value at the given index.