File: SVRayTypes.mesa
Created July 29, 1984 3:16:53 pm PDT
Copyright © 1984 by Xerox Corporation. All rights reserved.
Last edited by Bier on August 1, 1985 0:29:44 am PDT
DIRECTORY
Imager,
Rope,
SV2d,
SV3d,
SVModelTypes;
SVRayTypes: DEFINITIONS =
BEGIN
Artwork: TYPE = SVModelTypes.Artwork;
BoundBox: TYPE = SVModelTypes.BoundBox;
BoundHedron: TYPE = SVModelTypes.BoundHedron;
BoundSphere: TYPE = SVModelTypes.BoundSphere;
Color: TYPE = Imager.Color;
CoordSystem: TYPE = SVModelTypes.CoordSystem;
Matrix4by4: TYPE = SV3d.Matrix4by4;
Point2d: TYPE = SV2d.Point2d;
Vector: TYPE = SV3d.Vector;
Types of Ray casting procedures.
RayCastProc: TYPE = PROC [cameraPoint: Point2d, localRay: Ray, masterObject: REF ANY, prim: Primitive] RETURNS [class: Classification];
RayCastNoBBoxesProc: TYPE = PROC [localRay: Ray, masterObject: REF ANY, prim: Primitive] RETURNS [class: Classification];
RayCastBoundingSpheresProc: TYPE = PROC [localRay: Ray, masterObject: REF ANY, prim: Primitive] RETURNS [class: Classification];
Surface: TYPE = REF ANY; -- may be RectSurface, TubeSurface, DiskSurface, ShellSurface...
Classification: TYPE = REF ClassificationObj;
ClassificationObj: TYPE = RECORD [
count: NAT,
params: ParameterArray,
surfaces: SurfaceArray,
primitives: PrimitiveArray,-- the primitive from which each surface came
classifs: InOutArray,
normals: NormalArray];
maxSceneDepth: NAT = 40;
ParameterArray: TYPE = ARRAY [1..maxSceneDepth] OF REAL;
InOutArray: TYPE = ARRAY [1..maxSceneDepth] OF BOOL;
NormalArray: TYPE = ARRAY [1..maxSceneDepth] OF Vector;
SurfaceArray: TYPE = REF SurfaceArrayObj;
SurfaceArrayObj: TYPE = ARRAY [1..maxSceneDepth] OF Surface;
PrimitiveArray: TYPE = ARRAY [1..maxSceneDepth] OF Primitive;
Remember to update DisplayListToTree.PrimitiveFromAssembly if this definition changes.
Primitive: TYPE = REF PrimitiveObj;
PrimitiveObj: TYPE = RECORD [
name: Rope.ROPE,
artwork: Artwork,
assembly: REF ANY, -- a DisplayList3d.Assembly. REF ANY avoids compilation dependencies.
mo: REF ANY, -- should be MasterObject but oh the compilation dependencies!
rayCast: RayCastProc,
rayCastNoBBoxes: RayCastNoBBoxesProc,
rayCastBoundingSpheres: RayCastBoundingSpheresProc,
primWRTAssembly: CoordSystem,
scalars: Vector,
worldWRTPrim: Matrix4by4,
primWRTWorld: Matrix4by4,
hints: REF ANY, -- each object type may wish to store helpful information here
boundBox: BoundBox,
boundSphere: BoundSphere,
boundHedron: BoundHedron,
inverted: BOOL, -- is this shape to be subtracted?
currentRay: Ray,
rayStepX: Ray];
Ray: TYPE = REF RayObj;
RayObj: TYPE; -- see CSGImpl for the read record
PointSetOp: TYPE = {union, intersection, difference};
Composite: TYPE = REF CompositeObj;
CompositeObj: TYPE = RECORD [
name: Rope.ROPE,
operation: PointSetOp,
leftSolid: REF ANY,
rightSolid: REF ANY,
boundBox: BoundBox,
boundSphere: BoundSphere];
CSGTree: TYPE = REF CSGTreeObj;
CSGTreeObj: TYPE = RECORD [
name: Rope.ROPE,
son: REF ANY,
backgroundColor: Color,
shadows: BOOL];
END.