Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: CCD Problem
PostPosted: Fri Jun 30, 2017 1:37 pm 
Offline

Joined: Fri Jun 30, 2017 1:11 pm
Posts: 1
I read a lot about CCD in the last few hours, but still I can't figure out a way to prevent my game's items from falling through the walls or floors in my game.

From what I understand the CcdMotionThreshold is the delta movement which the rigid body needs to exceed in one simulation step, before CCD kicks in, right? And the CcdSweptSphereRadius is the radius of the sphere that is then used to check for possible collisions all along the movement vector of the object.

What I don't understand is: does the swept sphere have to be bigger than the actual object so it contains all of the object or does it need to be smaller than the actual object so that the CCD algorithm does not miss an interception with another object?

I also figured that if I set the CCD threshold to the size of the shortest dimension of the bounding box surrounding my object, then the CCD should (in theory) always kick in when it is actually possible for the object to tunnel through another object, right? My game is moddable, so the items in the game can have various sizes, so I need a formula to calculate the right values for CcdMotionThreshold and CcdSweptSphere.

Also, despite of my best affords I was unable to prevent some items from falling through the floor and walls. Even if I set the CCD threshold to a very small number (e.g. 1e-7), the objects sometimes fall through.


Top
 Profile  
 
 Post subject: Re: CCD Problem
PostPosted: Thu Jul 06, 2017 5:04 pm 
Offline
User avatar

Joined: Tue Sep 30, 2014 6:03 pm
Posts: 306
Location: San Francisco
I've used CCD. I set the proxy sphere to be smaller than the bounding box of the object: the diameter was about 3/4 of the average of the two smallest sides of the bounding box, or something like that.

The per-object CCD speed threshold was set to the diameter of the CCD proxy sphere divided by the fixed substep time.

Even with these settings sometimes objects could tunnel through others: in particular long thin objects tumbling on a btBvhTriangleMeshShape floor. For best results only use convex shapes for your floors.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group