pub struct Geometry {
pub topology: PrimitiveTopology,
pub draw_range: Range<u32>,
pub bounding_box: BoundingBox,
pub bounding_sphere: BoundingSphere,
/* private fields */
}Fields§
§topology: PrimitiveTopology§draw_range: Range<u32>§bounding_box: BoundingBox§bounding_sphere: BoundingSphereImplementations§
Source§impl Geometry
impl Geometry
Sourcepub fn morph_target_count(&self) -> u32
pub fn morph_target_count(&self) -> u32
Returns the number of morph targets in this geometry.
Sourcepub fn morph_vertex_count(&self) -> u32
pub fn morph_vertex_count(&self) -> u32
Returns the vertex count per morph target.
pub fn morph_target_names(&self) -> &[String]
pub fn new() -> Geometry
pub fn layout_version(&self) -> u64
pub fn structure_version(&self) -> u64
pub fn data_version(&self) -> u64
pub fn attributes(&self) -> &HashMap<String, Attribute, FxBuildHasher>
pub fn index_attribute(&self) -> Option<&IndexAttribute>
pub fn index_attribute_mut(&mut self) -> &mut Option<IndexAttribute>
pub fn set_attribute(&mut self, name: &str, attr: Attribute)
pub fn remove_attribute(&mut self, name: &str) -> Option<Attribute>
pub fn get_attribute(&self, name: &str) -> Option<&Attribute>
pub fn get_attribute_mut(&mut self, name: &str) -> Option<&mut Attribute>
pub fn add_morph_attribute(&mut self, morph_name: &str, attr: Attribute)
Sourcepub fn build_morph_storage_buffers(&mut self)
pub fn build_morph_storage_buffers(&mut self)
Builds compact Storage Buffers from morph_attributes
Layout: [ Target 0 all vertices | Target 1 all vertices | … ]
Each vertex stores 3 f32 values (compact Vec3)
Sourcepub fn morph_position_bytes(&self) -> Option<&[u8]>
pub fn morph_position_bytes(&self) -> Option<&[u8]>
Gets the byte slice of morph position data
Sourcepub fn morph_normal_bytes(&self) -> Option<&[u8]>
pub fn morph_normal_bytes(&self) -> Option<&[u8]>
Gets the byte slice of morph normal data
Sourcepub fn morph_tangent_bytes(&self) -> Option<&[u8]>
pub fn morph_tangent_bytes(&self) -> Option<&[u8]>
Gets the byte slice of morph tangent data
Sourcepub fn has_morph_targets(&self) -> bool
pub fn has_morph_targets(&self) -> bool
Checks if morph targets exist
pub fn set_indices(&mut self, indices: &[u16])
pub fn set_indices_u32(&mut self, indices: &[u32])
pub fn compute_vertex_normals(&mut self)
pub fn compute_bounding_volume(&mut self)
Sourcepub fn set_bounding_volume(&mut self, bbox: BoundingBox)
pub fn set_bounding_volume(&mut self, bbox: BoundingBox)
Sets the bounding volume directly from pre-computed AABB bounds.
Used by the quantised geometry pipeline where the position data is not in
Float32x3 format. The glTF specification guarantees that accessor min/max
are always real-valued floating-point world-space coordinates, so we can use
them directly without decoding the quantised vertex data on the CPU.
Sourcepub fn set_interleaved_attributes(
&mut self,
interleaved_data: Vec<u8>,
stride: u64,
attributes: Vec<(&str, VertexFormat, u64)>,
)
pub fn set_interleaved_attributes( &mut self, interleaved_data: Vec<u8>, stride: u64, attributes: Vec<(&str, VertexFormat, u64)>, )
Sets interleaved attributes Creates multiple Attributes sharing the same Buffer from an interleaved array
Sourcepub fn update_attribute_region<T>(
&mut self,
name: &str,
offset_bytes: u64,
data: &[T],
)where
T: Pod,
pub fn update_attribute_region<T>(
&mut self,
name: &str,
offset_bytes: u64,
data: &[T],
)where
T: Pod,
Partially updates attribute data
Sourcepub fn shader_defines(&self) -> &ShaderDefines
pub fn shader_defines(&self) -> &ShaderDefines
Computes the geometry’s shader macro definitions
Uses internal caching mechanism, only recalculates when layout_version changes.
This avoids Map traversal overhead on the hot path.
pub fn new_box(width: f32, height: f32, depth: f32) -> Geometry
pub fn new_sphere(radius: f32) -> Geometry
pub fn new_plane(width: f32, height: f32) -> Geometry
Trait Implementations§
Source§impl Bindings for Geometry
impl Bindings for Geometry
fn define_bindings<'a>(&'a self, builder: &mut ResourceBuilder<'a>)
Source§impl ResolveGeometry for Geometry
impl ResolveGeometry for Geometry
fn resolve(self, assets: &AssetServer) -> GeometryHandle
Auto Trait Implementations§
impl Freeze for Geometry
impl RefUnwindSafe for Geometry
impl Send for Geometry
impl Sync for Geometry
impl Unpin for Geometry
impl UnsafeUnpin for Geometry
impl UnwindSafe for Geometry
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().