CCD for specific collisionGroup or Entity

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
imtrobin
Posts: 101
Joined: Thu Jun 11, 2009 3:03 am

CCD for specific collisionGroup or Entity

Post 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
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: CCD for specific collisionGroup or Entity

Post 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.
imtrobin
Posts: 101
Joined: Thu Jun 11, 2009 3:03 am

Re: CCD for specific collisionGroup or Entity

Post 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 :)
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: CCD for specific collisionGroup or Entity

Post 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.
imtrobin
Posts: 101
Joined: Thu Jun 11, 2009 3:03 am

Re: CCD for specific collisionGroup or Entity

Post 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.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: CCD for specific collisionGroup or Entity

Post 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.
Post Reply