pub struct PackedGeometry { /* private fields */ }Expand description
Materialized primitive geometry with contiguous attribute and index buffers.
use draco_gltf::{ComponentType, PackedAttribute, PackedGeometry, PrimitiveMode};
let position = PackedAttribute::new(
"POSITION", 1, 3, ComponentType::F32, false, vec![0; 12],
)?;
let geometry = PackedGeometry::new(PrimitiveMode::Points, vec![position], None)?;
assert_eq!(geometry.vertex_count(), 1);Implementations§
Source§impl PackedGeometry
impl PackedGeometry
Sourcepub fn new(
mode: PrimitiveMode,
attributes: Vec<PackedAttribute>,
indices: Option<PackedIndices>,
) -> Result<Self, GeometryError>
pub fn new( mode: PrimitiveMode, attributes: Vec<PackedAttribute>, indices: Option<PackedIndices>, ) -> Result<Self, GeometryError>
Creates and validates one materialized primitive.
Sourcepub const fn mode(&self) -> PrimitiveMode
pub const fn mode(&self) -> PrimitiveMode
Returns the primitive topology.
Sourcepub fn vertex_count(&self) -> usize
pub fn vertex_count(&self) -> usize
Returns the shared vertex count.
Sourcepub fn attributes(&self) -> &[PackedAttribute]
pub fn attributes(&self) -> &[PackedAttribute]
Borrows the packed vertex attributes in document order.
Sourcepub fn indices(&self) -> Option<&PackedIndices>
pub fn indices(&self) -> Option<&PackedIndices>
Borrows the optional packed index stream.
Sourcepub fn validate(&self, profile: ValidationProfile) -> Result<(), GeometryError>
pub fn validate(&self, profile: ValidationProfile) -> Result<(), GeometryError>
Validates the geometry against a glTF profile.
Trait Implementations§
Source§impl Clone for PackedGeometry
impl Clone for PackedGeometry
Source§fn clone(&self) -> PackedGeometry
fn clone(&self) -> PackedGeometry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PackedGeometry
impl Debug for PackedGeometry
impl Eq for PackedGeometry
Source§impl PartialEq for PackedGeometry
impl PartialEq for PackedGeometry
impl StructuralPartialEq for PackedGeometry
Auto Trait Implementations§
impl Freeze for PackedGeometry
impl RefUnwindSafe for PackedGeometry
impl Send for PackedGeometry
impl Sync for PackedGeometry
impl Unpin for PackedGeometry
impl UnsafeUnpin for PackedGeometry
impl UnwindSafe for PackedGeometry
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