Intersection Testing

pfNode and all of its subclasses provide an isect() method for performing intersection testing. The test can return information on the point of intersection, the triangle intersected, the GeoSet intersected, and the normal at the point of intersection. isect() uses a pfSegSet to define the rays to test, and a pfHit array to return the intersections.

	pfNode *node;
	pfSegSet segset;
	pfHit **hits[32];
	...
	node->isect(&segset, hits);

pfSegSet

A pfSegSet structure contains an array of up to 32 rays (pfSeg's), and flags for controlling the intersection traversal.

pfHit

The results of any intersections are returned in a pfHit array. hits[i] reports the intersection of segset.segs[i] with the database.

(*hits[i])->query(which,dst) is used to get specific information. Some possible options for which are:

The values returned for the point and normal are in local coordinates; they must be multiplied by the node's transformation to get scene coordinates.




Sample programs:


Previous page    Table of contents    Next page

Last modified 5 February 1996.

Dave Pape, pape@evl.uic.edu