Page 1 of 1

CCD for specific collisionGroup or Entity

Posted: Fri Jul 31, 2009 12:08 pm
by imtrobin
Hi

Is it possible to specify CCD on for a specific entity or collisionGroup. I can only see it enables on all kinematic in the Space. I figured it would be quite expensive for all kinematics

Re: CCD for specific collisionGroup or Entity

Posted: Fri Jul 31, 2009 1:06 pm
by Norbo
Currently, it is only universal. It's pretty cheap though. It will only perform CCD operations when a collision pair exists. In the vast majority of pairs, it can early-out of the system extremely quickly.

Re: CCD for specific collisionGroup or Entity

Posted: Fri Jul 31, 2009 1:54 pm
by imtrobin
Ok, I thought the whole point of CCD is in case collision pairs are not created, but I take your word for it :)

Re: CCD for specific collisionGroup or Entity

Posted: Fri Jul 31, 2009 2:18 pm
by Norbo
I'll go ahead and explain a little further because it might be good to know in some situations.

The bounding box of an entity is used in the broadphase to collect collision pairs. However, if the bounding box was tightly wrapped around only the entity, a fast moving entity could skip through another entity without ever having the chance to create a collision pair like you mentioned.

Instead of allowing that to happen, an entity's bounding box is expanded so that it encompasses the 'swept' version of the shape. That way, even a fast object will have a collision pair with an obstacle. Full continuous collision detection also expands the bounding box slightly to account for angular motion, allowing it to collect collision pairs for long, fast-spinning objects.

Re: CCD for specific collisionGroup or Entity

Posted: Fri Jul 31, 2009 4:38 pm
by imtrobin
I see. since I don't have the source, this just seems a little different CCD from what I see Physx. I thought you are supposed to generate the sweep volume from the new position from previous instead of just expanding it slightly, hence the expensiveness.

Re: CCD for specific collisionGroup or Entity

Posted: Fri Jul 31, 2009 4:44 pm
by Norbo
The result is that it does, in fact, sweep from old to new state. The new state is extrapolated ahead to predict collision pairs. The bounding box is as tight as possible around this possible new state.

The bounding box surrounding the swept volume is essentially the same in both cases (extrapolation or using two previous states). There is not really any additional expense either way as far as the broad phase is concerned.