pub struct GltfPrimitive { /* private fields */ }Expand description
A Gltf primitive, as deserialized from the Gltf Json
Implementations§
Source§impl GltfPrimitive
impl GltfPrimitive
pub fn new( mode: PrimitiveType, indices: Option<AccessorIndex>, material: Option<MaterialIndex>, ) -> Self
Sourcepub fn indices(&self) -> Option<AccessorIndex>
pub fn indices(&self) -> Option<AccessorIndex>
Return the AccessorIndex for the indices of the primitive - or None if one was not specified (drawArrays should be used to render the primitive)
Sourcepub fn primitive_type(&self) -> PrimitiveType
pub fn primitive_type(&self) -> PrimitiveType
Return the mod3d_base::PrimitiveType of the primitive (TriangleStrip, etc)
Sourcepub fn attributes(&self) -> &[(VertexAttr, AccessorIndex)]
pub fn attributes(&self) -> &[(VertexAttr, AccessorIndex)]
Return a slice of tuples of mod3d_base::VertexAttr and AccessorIndex from the Gltf for the primitive
Sourcepub fn material(&self) -> Option<MaterialIndex>
pub fn material(&self) -> Option<MaterialIndex>
Return the AccessorIndex from the Gltf for the primitive
pub fn add_attribute(&mut self, attr: VertexAttr, accessor: AccessorIndex)
Trait Implementations§
Source§impl Debug for GltfPrimitive
impl Debug for GltfPrimitive
Source§impl Default for GltfPrimitive
impl Default for GltfPrimitive
Source§fn default() -> GltfPrimitive
fn default() -> GltfPrimitive
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for GltfPrimitive
impl<'de> Deserialize<'de> for GltfPrimitive
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GltfPrimitive
impl RefUnwindSafe for GltfPrimitive
impl Send for GltfPrimitive
impl Sync for GltfPrimitive
impl Unpin for GltfPrimitive
impl UnwindSafe for GltfPrimitive
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more