Ray Intersection

High-Level Functions

AsteroidShapeModels.intersect_ray_shapeFunction
intersect_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: Ray
  • shape: Shape model
  • bbox: Bounding box of the shape model

Returns

  • RayShapeIntersectionResult object containing the intersection test result
source

Low-Level Functions

AsteroidShapeModels.intersect_ray_triangleFunction
intersect_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: Ray
  • v1: Triangle vertex 1
  • v2: Triangle vertex 2
  • v3: Triangle vertex 3

Returns

  • RayTriangleIntersectionResult object containing the intersection test result
source
AsteroidShapeModels.intersect_ray_bounding_boxFunction
intersect_ray_bounding_box(ray::Ray, bbox::BoundingBox) -> Bool

Perform intersection test between a ray and a bounding box.

Arguments

  • ray: Ray
  • bbox: Bounding box

Returns

  • true if intersection occurs, false otherwise
source
AsteroidShapeModels.compute_bounding_boxFunction
compute_bounding_box(shape::ShapeModel) -> BoundingBox

Compute the bounding box of a shape model.

Arguments

  • shape: Shape model

Returns

  • BoundingBox object representing the bounding box
source