G3dRayCube.mesa
Copyright Ó 1988, 1992 by Xerox Corporation. All rights reserved.
Bloomenthal, July 15, 1992 11:07 pm PDT
DIRECTORY G3dBasic, G3dOctree;
Imported Types
Ray: TYPE ~ G3dBasic.Ray;
Cube: TYPE ~ G3dOctree.Cube;
Octree: TYPE ~ G3dOctree.Octree;
Intersection: TYPE ~ G3dOctree.Intersection;
IntersectionList: TYPE ~ G3dOctree.IntersectionList;
Ray-Cube Operations
IntersectRayWithCube:
PROC [ray: Ray, cube: Cube]
RETURNS [Intersection];
Find first intersection (either entering or leaving) of ray with cube.
IntersectRayInsideCube:
PROC [ray: Ray, cube: Cube]
RETURNS [Intersection];
Assuming ray.base is within cube, find intersection of ray with cube.
IntersectRayOutsideCube:
PROC [ray: Ray, cube: Cube]
RETURNS [Intersection];
Assuming ray.base is outside cube, find intersection of ray with cube.
FirstIntersectionWithOctree:
PROC [ray: Ray, octree: Octree]
RETURNS [Intersection];
Find first intersection of ray with a terminal node; ray.axis is presumed normalized.
IntersectRayWithOctree:
PROC [ray: Ray, octree: Octree]
RETURNS [IntersectionList];
Return a list of the intersections of the ray with the terminal nodes of the Octree.
The intersection leaving a cube and that entering an adjacent one (i.e., the same point)
are both added to the list. ray.axis is presumed normalized.