retrieving intersection masks

New Message Reply Date view Thread view Subject view Author view

Bruce Cameron (bmc++at++spitfire.mayo.EDU)
Tue, 13 Sep 1994 09:44:40 -0500


In my code, I set the intersection traversal masks as follows
at load time.

if ((gptr = strstr (DatabaseFiles[i], "GOOD")) != NULL){
    pfNodeTravMask (root, PFTRAV_ISECT, 0x01,
    PFTRAV_SELF|PFTRAV_DESCEND|PFTRAV_IS_CACHE, PF_SET);
}
else{
    pfNodeTravMask (root, PFTRAV_ISECT, 0x02,
    PFTRAV_SELF|PFTRAV_DESCEND|PFTRAV_IS_CACHE, PF_SET);
}

To setup my intersection segments, I use:

segset.activeMask = 1;
segset.isectMask = 0x01|0x02;
segset.mode = PFTRAV_IS_PRIM|PFTRAV_IS_PATH|PFTRAV_IS_CULL_BACK;
segset.segs[0].length = PROBE_LEN;
pfSetVec3 (segset.segs[0].pos, x, y, z);
pfSetVec3 (segset.segs[0].dir, dx, dy, dz);

During the simulation, I use the following to detect intersections
with the data.

isect = pfSegsIsectNode (ViewState->sceneGroup, &segset, hits);
if (isect) {
    pfQueryHit (*hits[0], PFQHIT_POINT, &pnt);
    pfQueryHit (*hits[0], PFQHIT_NODE, &inode);
    mask = pfGetNodeTravMask (inode, PFTRAV_ISECT);
    if (mask == 0x02) {
        fprintf (stderr, "bad object\n"); fflush (stderr);
    }
    else if (mask == 0x01){
        fprintf (stderr, "good object\n"); fflush (stderr);
    }
}

Unfortunately, the mask is 0xffffffff regardless of the object
intersected with. Is there a way to retrieve the intersection
traversal mask? If so, what am I doing wrong?

Thanks in advance.

-- 
--Bruce
-----------------------------------------------------
Bruce M. Cameron		bmc++at++mayo.edu
Mayo Foundation			office: (507) 284-3288
200 1st St SW			fax:    (507) 284-1428
Rochester, MN 55905		ARS WD9CKW

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:32 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.