Re: Collision detection on dynamic pfGeoSet

New Message Reply Date view Thread view Subject view Author view

From: Yair Kurzion (yair++at++polygon.engr.sgi.com)
Date: 03/30/2000 14:12:01


Hello Kim and Bent !

> We have made an application with dynamic geometry, and we
> want to do a collision intersection with this geometry.
>
> When we use a normal pfGeoSet the collision detection is occuring where
> the dynamic geometry initially was. Therefore we converted the geometry
> array from a pfVec3 to pfFlux. But it is still not working. We do not use
> a pfEngine, but is that really necessary?
>
> So the question is how to make collision detection on dynamic pfGeoSet?

My answer below assumes that you flux the COORD attribute of the pfGeoSet. If
the entire pfGeoSet is Flux'ed, things are a little simpler.

So, I can think of two things that may have gone wrong:

When Performer intersects a line segment with a pfGeoSet, it starts by testing
the intersection with the pfGeoSet bounding box. When you use a pfFlux to change
your pfGeoSet geometry, the pfGeoSet bounding box is not updated. You have two
ways to fix this:
1. If your dynamic geometry moves in a known boundary, you can set the bounding
   box staticly to the full boundary where your dynamic geometry may reach.
2. You can use pfGeoSet::setBoundFlux to set a bounding box pfFlux on a
   pfGeoSet. Every time you change the COORD flux, you have to re-compute the
   bounding box and write to the bounding-box pfFlux.

Performer intersection has optimizations for static geometry. The second
parameter of pfGeoSet::setIsectMask can set/unset a cache on a pfGeoSet. This
cache is used for intersecting against pfGeoSet geometry. When you modify your
Fluxed dynamic geometry, the cache is not notified, and is therefore incorrect.
So, if you use PFTRAV_IS_CACHE on a dynamic pfGeoSet, the results will be
incorrect.

-yair

-- 
\_________  \_____  \__    \__  \_____         Yair Kurzion
\_________  \_____   \__   \__  \_____         yair++at++sgi.com
       \__     \__   \____\__      \__   http://reality.sgi.com/yair
       \__          \__  \__                Work: (650) 933-6502
       \__          \__   \__               Home: (408) 226-9771
       \__          \__    \__             


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Mar 30 2000 - 14:12:29 PST

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