#[non_exhaustive]pub enum SubObjectRef {
Face(u32),
Vertex(u32),
Edge(u32),
Point(u32),
Voxel(u32),
Cell(u32),
Splat(u32),
Instance(u32),
Segment(u32),
Strip(u32),
}Expand description
A typed reference to a sub-object within a parent scene object.
Produced by all pick functions when a specific surface feature is hit, and
stored in PickHit::sub_object.
§Variants
Face: triangular face, by index in the triangle list. Indexiaddresses verticesindices[3i..3i+3].Vertex: mesh vertex, by position in the vertex buffer.Edge: mesh edge (from parry3dFeatureId::Edge; rarely produced by TriMesh ray casts in practice).Point: point in a point-cloud object, by index in the positions slice.Voxel: voxel in a structured scalar volume.Cell: cell in an unstructured volume mesh (VolumeMeshData).Splat: gaussian splat, by index in the splat buffer.Instance: glyph, tensor glyph, or sprite instance, by instance index.Segment: polyline, tube, or ribbon segment, by index.Strip: connected curve strip within a multi-strip item, by strip index.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Face(u32)
A triangular face identified by its index in the triangle list.
Vertex(u32)
A mesh vertex identified by its position in the vertex buffer.
Edge(u32)
A mesh edge identified by its edge index (parry3d::shape::FeatureId::Edge).
Rarely produced in practice; included for completeness.
Point(u32)
A point within a point-cloud object, by its index in the positions slice.
Voxel(u32)
A voxel within a ray-marched volume, by its flat grid index.
The flat index encodes (ix, iy, iz) as ix + iy * nx + iz * nx * ny.
Recover the 3-D indices using the grid dimensions from
VolumeData.
Cell(u32)
A cell within an unstructured volume mesh, by its index in
VolumeMeshData::cells.
Produced by pick_transparent_volume_mesh_cpu
and pick_transparent_volume_mesh_rect.
Splat(u32)
A gaussian splat identified by its index in the splat buffer.
Instance(u32)
A glyph, tensor glyph, or sprite instance identified by its instance index.
Segment(u32)
A polyline, tube, or ribbon segment identified by its segment index.
Strip(u32)
A connected curve strip within a multi-strip item, identified by its strip index.
Implementations§
Source§impl SubObjectRef
impl SubObjectRef
Sourcepub fn from_feature_id(f: FeatureId) -> Option<Self>
pub fn from_feature_id(f: FeatureId) -> Option<Self>
Convert from a parry3d FeatureId.
Returns None for FeatureId::Unknown (not expected from TriMesh ray casts).
Trait Implementations§
Source§impl Clone for SubObjectRef
impl Clone for SubObjectRef
Source§fn clone(&self) -> SubObjectRef
fn clone(&self) -> SubObjectRef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SubObjectRef
impl Debug for SubObjectRef
Source§impl<'de> Deserialize<'de> for SubObjectRef
impl<'de> Deserialize<'de> for SubObjectRef
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>,
Source§impl Hash for SubObjectRef
impl Hash for SubObjectRef
Source§impl PartialEq for SubObjectRef
impl PartialEq for SubObjectRef
Source§fn eq(&self, other: &SubObjectRef) -> bool
fn eq(&self, other: &SubObjectRef) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for SubObjectRef
impl Serialize for SubObjectRef
impl Copy for SubObjectRef
impl Eq for SubObjectRef
impl StructuralPartialEq for SubObjectRef
Auto Trait Implementations§
impl Freeze for SubObjectRef
impl RefUnwindSafe for SubObjectRef
impl Send for SubObjectRef
impl Sync for SubObjectRef
impl Unpin for SubObjectRef
impl UnsafeUnpin for SubObjectRef
impl UnwindSafe for SubObjectRef
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.