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.
A pfSegSet structure contains an array of up to 32 rays (pfSeg's),
and flags for controlling the intersection traversal.
- segset.activeMask = bit mask indicating which pfSeg's to use;
to just test segs, activeMask = 1
- segset.mode = bitwise OR of traversal flags:
- PFTRAV_IS_PRIM - intersect with primitives (triangles)
- PFTRAV_IS_NORM - return normal at point of intersection
- PFTRAV_IS_CULL_BACK - don't test backfacing polygons
- segset.segs = list of rays to test. To create a pfSeg defining
a ray from (pfVec3 a) to (pfVec3 b), use
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
- PFHIT_POINT - point of intersection; (float dst)
- PFHIT_NORM - polygon normal; (float dst)
- PFHIT_XFORM - scene transformation at intersected node; (float dst)
Last modified 21 July 1997.
Dave Pape, email@example.com