Struct gltf_json::mesh::Primitive
[−]
pub struct Primitive { pub attributes: HashMap<Checked<Semantic>, Index<Accessor>>, pub extensions: Primitive, pub extras: Extras, pub indices: Option<Index<Accessor>>, pub material: Option<Index<Material>>, pub mode: Checked<Mode>, pub targets: Option<Vec<MorphTargets>>, }
Geometry to be rendered with the given material.
Fields
attributes: HashMap<Checked<Semantic>, Index<Accessor>>
Maps attribute semantic names to the Accessor
s containing the
corresponding attribute data.
extensions: Primitive
Extension specific data.
extras: Extras
Optional application specific data.
indices: Option<Index<Accessor>>
The index of the accessor that contains the indices.
material: Option<Index<Material>>
The index of the material to apply to this primitive when rendering
mode: Checked<Mode>
The type of primitives to render.
targets: Option<Vec<MorphTargets>>
An array of Morph Targets, each Morph Target is a dictionary mapping
attributes (only POSITION
, NORMAL
, and TANGENT
supported) to their
deviations in the Morph Target.
Trait Implementations
impl Clone for Primitive
fn clone(&self) -> Primitive
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 Primitive
impl Validate for Primitive
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.