volume 2 volume intersection

New Message Reply Date view Thread view Subject view Author view

Liu Xiaoyan (liuxy++at++nsrc.nus.sg)
Wed, 18 Feb 1998 19:59:26 +0800


Hi, performers,

I'm doing a simple volume to volume intersection in Performer,
a moving pfCylinder built around the bounding sphere of an object
and other objects, looks like:

       // collision detection between one moving target and other static
objects
           pfSegSet segset;
           pfHit **hits[32];
           int numHit = 0;

           pfSphere boundBall; // bounding box of the moving
object
           getBound(&boundBall);
           pfCylinder *cylinder = new pfCylinder;
           pfSphere **list = (pfSphere **)pfMalloc(1 * sizeof(pfSphere
*),NULL);
           list[0] = &boundBall;
           cylinder->around((const pfSphere **)list,1); // cylinder

           segset.mode = PFTRAV_IS_PATH | PFTRAV_IS_GSET |
PFTRAV_IS_BCYL;
           segset.userData = (void *)NULL;
           segset.activeMask = 0x0; // or 0xFFFF????
           segset.isectMask = HITABLE; // Intersection mask
           segset.bound = (void *)cylinder;
           segset.discFunc = NULL;
           numHit =
((this->getParent(0))->getParent(0))->isect(&segset,hits);
  
 I'm not sure of the value for segset.activeMask in this case of a
cylinder detection.
 When set as 0xFFFF, always hits detected; If set as 0, always no hit.
Neither is
 correct. What's wrong with my code?

Thanks for any help.

Liu Xiaoyan
            
***********************************************************************
Liu Xiaoyan National Supercomputing Research Center
Data Visualization Group http://www.nsrc.nus.edu.sg Tel:(65)7709267
***********************************************************************
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


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:56:47 PDT

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