File: SVObjectCast.mesa
Last edited by Bier on June 1, 1984 5:13:12 pm PDT
Author: Eric Bier on June 1, 1987 11:03:17 am PDT
Contents: Procedures to determine intersections of rays with primitive objects
DIRECTORY
SV2d, SV3d, SVMasterObjectTypes, SVSceneTypes;
SVObjectCast: CEDAR DEFINITIONS =
BEGIN
BlockData: TYPE = SVMasterObjectTypes.BlockData;
Composite: TYPE = SVSceneTypes.Composite;
CSGTree: TYPE = SVSceneTypes.CSGTree;
Point2d: TYPE = SV2d.Point2d;
Point3d: TYPE = SV3d.Point3d;
Primitive: TYPE = SVSceneTypes.Primitive;
Surface: TYPE = REF ANY;
Vector3d: TYPE = SV3d.Vector3d;
RectSurface: TYPE = REF RectSurfaceObj;
RectSurfaceObj:
TYPE =
RECORD [
rectType: RectType];
RectType: TYPE = {up, down, left, right, front, back};
TubeSurface: TYPE = REF TubeSurfaceObj;
TubeSurfaceObj:
TYPE =
RECORD [
];
DiskSurface: TYPE = REF DiskSurfaceObj;
DiskSurfaceObj:
TYPE =
RECORD [
diskType: DiskType];
DiskType: TYPE = {top, bottom};
ShellSurface: TYPE = REF ShellSurfaceObj;
ShellSurfaceObj:
TYPE =
RECORD [
];
ConeSurface: TYPE = REF ConeSurfaceObj;
ConeSurfaceObj:
TYPE =
RECORD [
];
ToroidalSurface: TYPE = REF ToroidalSurfaceObj;
ToroidalSurfaceObj:
TYPE =
RECORD [
];
ParameterArray: TYPE = SVSceneTypes.ParameterArray;
SurfaceArray: TYPE = SVSceneTypes.SurfaceArray;
InOutArray: TYPE = SVSceneTypes.InOutArray;
NormalArray: TYPE = SVSceneTypes.NormalArray;
Classification: TYPE = SVSceneTypes.Classification;
Ray: TYPE = SVSceneTypes.Ray;
HitRec: TYPE = REF HitRecObj;
HitRecObj:
TYPE =
RECORD [
t: REAL,
surf: Surface,
normal: Vector3d];
HitArray: TYPE = REF HitArrayObj;
HitArrayObj: TYPE = ARRAY[1..globalObjDepth] OF HitRec;
globalObjDepth: NAT = 6;
Each primitive shape must have a procedure here which can classify a ray with respect to it.
BlockCast: PROC [localRay: Ray, prim: Primitive, blockRec: BlockData, surfs: SurfaceArray] RETURNS [class: Classification];
SphereCast: PROC [localRay: Ray, thisShell: Surface, prim: Primitive] RETURNS [class: Classification];
CylinderCast: PROC [localRay: Ray, surfaces: SurfaceArray, prim: Primitive]
RETURNS [class: Classification];
ConeCast: PROC [localRay: Ray, surfaces: SurfaceArray, prim: Primitive] RETURNS [class: Classification];
ToroidCast: PROC [localRay: Ray, prim: Primitive, torusRec: REF ANY, surface: Surface]
RETURNS [class: Classification];
torusRec is a BasicObject3d.TorusRec. It is a REF ANY to avoid compilation dependencies
END.