Ray Intersection
High-Level Functions
AsteroidShapeModels.intersect_ray_shape
— Functionintersect_ray_shape(ray::Ray, shape::ShapeModel, bbox::BoundingBox) -> RayShapeIntersectionResult
Perform accelerated ray-shape intersection test using bounding box optimization. Uses the Möller–Trumbore algorithm for ray-triangle mesh intersection.
Arguments
ray
: Rayshape
: Shape modelbbox
: Bounding box of the shape model
Returns
RayShapeIntersectionResult
object containing the intersection test result
Low-Level Functions
AsteroidShapeModels.intersect_ray_triangle
— Functionintersect_ray_triangle(ray::Ray, v1::AbstractVector{<:Real}, v2::AbstractVector{<:Real}, v3::AbstractVector{<:Real}) -> RayTriangleIntersectionResult
Perform ray-triangle intersection test using the Möller–Trumbore algorithm.
Arguments
ray
: Rayv1
: Triangle vertex 1v2
: Triangle vertex 2v3
: Triangle vertex 3
Returns
RayTriangleIntersectionResult
object containing the intersection test result
AsteroidShapeModels.intersect_ray_bounding_box
— Functionintersect_ray_bounding_box(ray::Ray, bbox::BoundingBox) -> Bool
Perform intersection test between a ray and a bounding box.
Arguments
ray
: Raybbox
: Bounding box
Returns
true
if intersection occurs,false
otherwise
AsteroidShapeModels.compute_bounding_box
— Functioncompute_bounding_box(shape::ShapeModel) -> BoundingBox
Compute the bounding box of a shape model.
Arguments
shape
: Shape model
Returns
BoundingBox
object representing the bounding box