-- File: SVFacesCast.mesa
-- Last edited by Bier on December 18, 1982 1:23 am
-- Author: Eric Bier on August 27, 1982 11:33 am
-- Contents: Routines for finding the intersections of rays (see CSG.mesa) with simple faces (see SVFaces.mesa)

DIRECTORY
CSG,
 SVFaces,
 SVVector3d;

SVFacesCast: DEFINITIONS =
BEGIN

Cone: TYPE = REF ConeObj;
ConeObj: TYPE = SVFaces.ConeObj;
Cylinder: TYPE = REF CylinderObj;
CylinderObj: TYPE = SVFaces.CylinderObj;
DiskRing: TYPE = REF DiskRingObj;
DiskRingObj: TYPE = SVFaces.DiskRingObj;
EdgeOnRect: TYPE = REF EdgeOnRectObj;
EdgeOnRectObj: TYPE = SVFaces.EdgeOnRectObj;
Ray: TYPE = REF RayObj;
RayObj: TYPE = CSG.RayObj;
Vector: TYPE = SVVector3d.Vector;

FaceHitRec: TYPE = REF FaceHitRecObj;
FaceHitRecObj: TYPE = RECORD [params: ARRAY[1..2] OF REAL, count: NAT, normals: ARRAY[1..2] OF Vector];

ConeCast: PROC [cone: Cone, localRay: Ray] RETURNS [hits: FaceHitRec];
DiskRingCast: PROC [diskRing: DiskRing, localRay: Ray] RETURNS [hits: FaceHitRec];
CylinderCast: PROC [cylinder: Cylinder, localRay: Ray] RETURNS [hits: FaceHitRec];
EdgeOnRectCast: PUBLIC PROC [rect: EdgeOnRect, localRay: Ray] RETURNS [hits: FaceHitRec];


GetFaceHitFromPool: PROC RETURNS [faceHit: FaceHitRec];
ReturnFaceHitToPool: PROC [faceHit: FaceHitRec];

END.