pub struct Intersection {Show 14 fields
pub distance: f64,
pub distance_to_ray: Option<f64>,
pub point: Vector3,
pub point_on_line: Option<Vector3>,
pub index: Option<usize>,
pub face: Option<Face>,
pub face_index: Option<usize>,
pub uv: Option<Vector2>,
pub uv1: Option<Vector2>,
pub normal: Option<Vector3>,
pub barycoord: Option<Vector3>,
pub instance_id: Option<usize>,
pub batch_id: Option<usize>,
pub object: ObjectRef,
}Expand description
One entry of the array Raycaster.intersectObject() returns.
three.js builds a plain object whose keys depend on what was hit; every key
that some raycast() can leave out is an Option here, None being both
three’s absent key and its explicit null.
Fields§
§distance: f64distance — from the ray origin to the hit, in world units.
distance_to_ray: Option<f64>distanceToRay — Points only: how far the point is from the ray.
point: Vector3point — the hit in world space.
point_on_line: Option<Vector3>pointOnLine — LineSegments2 only: the closest point on the segment.
index: Option<usize>index — Line / Points only: the segment’s first vertex, or the
point.
face: Option<Face>face — meshes only.
face_index: Option<usize>faceIndex — the triangle number for a mesh, the segment number for a
LineSegments2.
uv: Option<Vector2>uv at the hit — meshes with a uv attribute, and sprites.
uv1: Option<Vector2>uv1 at the hit.
normal: Option<Vector3>normal — the interpolated vertex normal, flipped to face the ray.
barycoord: Option<Vector3>barycoord — the hit’s barycentric coordinates in the triangle.
instance_id: Option<usize>instanceId — InstancedMesh only.
batch_id: Option<usize>batchId — BatchedMesh only.
object: ObjectRefobject — the object that was hit.