Jeremy Friesner (jaf++at++chem.ucsd.edu)
Thu, 15 May 1997 16:27:19 -0700 (PDT)
The Performer Guide mentions the following tantalizing
possiblity in Chapter 6:
>If only a rough volume-volume intersection is required,
>you can specify a bounding cylinder in the pfSegSet
>without any line segments at all and request discriminator
>callbacks at the PFTRAV_IS_NODE or PFTRAV_IS_GSET level.
So I set this up in my app, and my discriminator callback
never got called. Grepping through the Performer Mailing
list archives, I found this posting, which sounds just
like my situation:
>>---- On Feb 17, 11:25am, Ulrich J Lechner wrote:
>>I would like to intersect my scene (on PFTRAV_IS_GEODE or PFTRAV_IS_GSET level)
>>with a simple cylinder or a box. What is the standard way to do this?
>>I tried to use a pfSegSet without any lines, a bounding cylinder and
>>a discriminator function (see pguide 186)
>>Result: My disc function is never called. I guess it is because of a missing
>>line segment. Did I do something wrong or is there another way to
>>test any object against a node. Do I have to use pfSphereContainsSphere
>>to test against every bounding volume for every node?
>
>We only do segment intersections and we call the discriminator function
>if there are actual active segments with length > 0.
>However, you could do an initial test of your own in the a
>pre-isect callback on the node that should get called for
>all nodes traversed, even with an empty segment set.
>src.o
What is this? Is Sharon saying that the functionality described
in the Performer Guide Quote does not actually exist? Or does
she just mean that you have to put at least one "dummy" pfSeg
in your bounding cylinder in order for your discriminator to
be called?
For the record, I tried putting a dummy pfSeg in my bounding cylinder,
and with that my discriminator callback was called occasionally, but
alas it was not called every time an object intersected with my bounding
cylinder. (I believe it was only getting called when something intersected
with the dummy pfSeg)
Assuming for the moment I cannot get this discriminator callback to work
correctly, Sharon mentions a pre-isect node callback. By this, I believe
she means using pfNode::setTravFuncs(PFTRAV_ISECT, myCallBack, NULL) to alter
the intersect requests behavior. I have some questions about that as
well. :) First off, is there an ISECT-traversal equivalent to pfGetCullResult()
somewhere? If there were, I could maybe use that to set callbacks on geometry
whose bounding volumes intersected with mine. Also, is there any way to
set per-pfTraverser user data? I note that the pfTraverser class has a
void * userData private field, but I don't see how to get at it.
Thanks,
Jeremy
=======================================================================
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:55:15 PDT