Re: volume 2 volume intersection
Mario Veraart (rioj7++at++fel.tno.nl)
Thu, 19 Feb 1998 11:58:59 +0100 (MET)
>
> 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
When you do a pfNode::isect() you must at least specify one segment of
the pfSegSet::segs[i]. The segments you fill in must be marked in
the pfSegSet::activeMask. Every bit in the mask corresponds with one
segment in the segs array.
For your case it means that you fill in segs[0]
and set activeMask to 0x01
Mario
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2
on Mon Aug 10 1998 - 17:56:48 PDT