0.6.0
Loading...
Searching...
No Matches

Data Types

type  mod_ray_tracing::t_ray
 Definition of a ray. More...
 
type  mod_ray_tracing::t_intersection
 Definition of an intersection. More...
 
type  mod_ray_tracing::t_intersection_list
 Sorted list of intersections. More...
 

Functions/Subroutines

pure type(t_ray) function mod_ray_tracing::rt_ray_partial_initialization (origin, direction)
 Initialize a ray from origin and direction only.
 
pure subroutine mod_ray_tracing::rt_get_transformed_ray (ray, transformation, transformed_ray)
 Get a transformed ray in the object frame.
 
pure subroutine mod_ray_tracing::rt_intersection_apply_transformation (intersection, transformation, ray, has_normal)
 Apply transformation to the intersection and compute the distance.
 
pure type(t_intersection) function mod_ray_tracing::rt_intersection_partial_initialization (point, distance)
 Initialize an interface from point and distance only.
 
pure type(t_intersection) function mod_ray_tracing::rt_intersection_partial_initialization_no_tag (point, distance, normal)
 Initialize an interface from point and distance only.
 
pure subroutine mod_ray_tracing::rt_intersection_list_clear (intersection_list)
 Clear the intersection list.
 
pure subroutine mod_ray_tracing::rt_intersection_list_push (intersection_list, intersection)
 Add an intersection to the list.
 
logical pure function, public mod_ray_tracing::rt_does_ray_hit_aligned_axis_bounding_box (ray, corner)
 Test the intersection of a ray and an aligned-axis bounding-box (AABB).
 
pure subroutine, public mod_ray_tracing::rt_transform_aligned_axis_bounding_box (corner, transformation)
 Transform an aligned-axis bounding-box (AABB).
 
pure subroutine, public mod_ray_tracing::rt_intersection_list_union (list1, list2, is_inside1, is_inside2, union)
 Generate the union of two lists of ray intersections.
 
pure subroutine, public mod_ray_tracing::rt_intersection_list_difference (list1, list2, is_inside1, is_inside2, difference)
 Generate the difference of two lists of ray intersections.
 

Detailed Description

Ray-tracing tools

Function/Subroutine Documentation

◆ rt_does_ray_hit_aligned_axis_bounding_box()

logical pure function, public mod_ray_tracing::rt_does_ray_hit_aligned_axis_bounding_box ( type(t_ray), intent(in) ray,
double precision, dimension(3,2), intent(in) corner )

Test the intersection of a ray and an aligned-axis bounding-box (AABB).

Reference:

  • Williams, A., Barrus, S., Morley, R. K., & Shirley, P. (2005). An efficient and robust ray-box intersection algorithm. In ACM SIGGRAPH 2005 Courses (pp. 9-es). doi:[10.1145/1198555.1198748]

The corner(:,1) contains the minimal coordinates and corner(:,2) contains the maximal coordinates.

Parameters
[in]rayRay.
[in]cornerCorners of the AABB.

◆ rt_get_transformed_ray()

pure subroutine mod_ray_tracing::rt_get_transformed_ray ( class(t_ray), intent(in) ray,
type(t_cg_transformation), intent(in) transformation,
type(t_ray), intent(out) transformed_ray )
private

Get a transformed ray in the object frame.

Parameters
[in]rayRay in the original frame (input)
[in]transformationtransformation.
[out]transformed_rayray in the transformed frame.

◆ rt_intersection_apply_transformation()

pure subroutine mod_ray_tracing::rt_intersection_apply_transformation ( class(t_intersection), intent(inout) intersection,
type(t_cg_transformation), intent(in) transformation,
type(t_ray), intent(in) ray,
logical, intent(in) has_normal )
private

Apply transformation to the intersection and compute the distance.

Parameters
[in,out]intersectionIntersection.
[in]transformationtransformation.
[in]rayray in the original frame.
[in]has_normalApply transformation to the normal.

◆ rt_intersection_list_clear()

pure subroutine mod_ray_tracing::rt_intersection_list_clear ( class(t_intersection_list), intent(inout) intersection_list)
private

Clear the intersection list.

Do not deallocate the list, just reset the number of intersections to zero.

Parameters
[in,out]intersection_listList of intersections.

◆ rt_intersection_list_difference()

pure subroutine, public mod_ray_tracing::rt_intersection_list_difference ( type(t_intersection_list), intent(in) list1,
type(t_intersection_list), intent(in) list2,
logical, intent(in) is_inside1,
logical, intent(in) is_inside2,
type(t_intersection_list), intent(out) difference )

Generate the difference of two lists of ray intersections.

Parameters
[in]list1,list2Lists of ray intersections.
[in]is_inside1,is_inside2Is the origin of the ray inside or outside?
[out]differenceDifference of list1 and list2.

◆ rt_intersection_list_push()

pure subroutine mod_ray_tracing::rt_intersection_list_push ( class(t_intersection_list), intent(inout) intersection_list,
type(t_intersection), intent(in) intersection )
private

Add an intersection to the list.

If the distance of the intersection to push is greater than the last item of the list, no insertion is required, this implies better performances.

Whenever it is possible, prefer to insert the intersections in a sorted order.

Parameters
[in,out]intersection_listList of intersections.
[in]intersectionIntersection.

◆ rt_intersection_list_union()

pure subroutine, public mod_ray_tracing::rt_intersection_list_union ( type(t_intersection_list), intent(in) list1,
type(t_intersection_list), intent(in) list2,
logical, intent(in) is_inside1,
logical, intent(in) is_inside2,
type(t_intersection_list), intent(out) union )

Generate the union of two lists of ray intersections.

Parameters
[in]list1,list2Lists of ray intersection.
[in]is_inside1,is_inside2Is the origin of the ray inside or outside?
[out]unionUnion of list1 and list2.

◆ rt_intersection_partial_initialization()

pure type(t_intersection) function mod_ray_tracing::rt_intersection_partial_initialization ( double precision, dimension(3), intent(in) point,
double precision, intent(in) distance )
private

Initialize an interface from point and distance only.

The normal vector is set to null vector.

Parameters
[in]pointIntersection point
[in]distanceIntersection distance
Returns
Initialized intersection

◆ rt_intersection_partial_initialization_no_tag()

pure type(t_intersection) function mod_ray_tracing::rt_intersection_partial_initialization_no_tag ( double precision, dimension(3), intent(in) point,
double precision, intent(in) distance,
double precision, dimension(3), intent(in) normal )
private

Initialize an interface from point and distance only.

The normal vector is set to null vector.

Parameters
[in]pointIntersection point
[in]distanceIntersection distance
[in]normalNormal vector at the intersection point
Returns
Initialized intersection

◆ rt_ray_partial_initialization()

pure type(t_ray) function mod_ray_tracing::rt_ray_partial_initialization ( double precision, dimension(3), intent(in) origin,
double precision, dimension(3), intent(in) direction )

Initialize a ray from origin and direction only.

Parameters
[in]originOrigin of the ray
[in]directionDirection of the ray
Returns
Initialized ray

◆ rt_transform_aligned_axis_bounding_box()

pure subroutine, public mod_ray_tracing::rt_transform_aligned_axis_bounding_box ( double precision, dimension(3,2), intent(inout) corner,
type(t_cg_transformation), intent(in) transformation )

Transform an aligned-axis bounding-box (AABB).

Parameters
[in,out]cornerCorners of the AABB.
[in]transformationTranformation applied to the AABB.