pub struct SceneRayHit {
pub node: NodeId,
pub primitive_index: usize,
pub hit: RayHit,
}Expand description
Closest-hit record produced by Scene3D::intersect_ray.
Pairs a world-space ray query with the scene-graph location of the hit:
node— theNodeIdof the reachable node whose attached mesh produced the hit. Look upnodes[node]for the node’s transform / parenting; pass the same index intoScene3D::world_node_transforms[node.0 as usize]for the world matrix that maps mesh-local coordinates back to world space.primitive_index— the index intonodes[node].mesh’sMesh::primitivesarray identifying which primitive within the mesh was struck. The innerhit.triangle_indexthen names the triangle inside that primitive’scrate::Primitive::triangle_indicesenumeration.hit— the underlyingcrate::ray::RayHitin mesh-local coordinates (barycentric, triangle index, front-face flag) but withtalready in world-space units: affine change-of-frame leaves the ray-parameter scalar invariant, so the sametreconstructs the world hit point viaworld_ray.point_at(scene_hit.hit.t).
Fields§
§node: NodeId§primitive_index: usize§hit: RayHitTrait Implementations§
Source§impl Clone for SceneRayHit
impl Clone for SceneRayHit
Source§fn clone(&self) -> SceneRayHit
fn clone(&self) -> SceneRayHit
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 moreimpl Copy for SceneRayHit
Source§impl Debug for SceneRayHit
impl Debug for SceneRayHit
Source§impl PartialEq for SceneRayHit
impl PartialEq for SceneRayHit
impl StructuralPartialEq for SceneRayHit
Auto Trait Implementations§
impl Freeze for SceneRayHit
impl RefUnwindSafe for SceneRayHit
impl Send for SceneRayHit
impl Sync for SceneRayHit
impl Unpin for SceneRayHit
impl UnsafeUnpin for SceneRayHit
impl UnwindSafe for SceneRayHit
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