This project has moved and is read-only. For the latest updates, please go here.

Whells and CCD

Topics: Developer Forum
Oct 11, 2010 at 1:36 PM

I had some problems with car's weels because of the CCD (snagging? I don't know the exact word... I'm French).

To resolve it, I added a new flag and a property named IgnoreCCD. The property is public and make it possible to enable or disable the flag.

The flag is then used in the SolveTOI() method or the World class to disable the Toi flag, so the CCD is not enabled on the body.


With this new flag, I can disable CCD on the bodies I want (in this case, the car's weels), and it works fine.

Oct 11, 2010 at 1:42 PM

Maybe you should suggest this on the Box2D forums. Erin from Box2D decided to implicit enable CCD between static and dynamic bodies, so this flag might be a good thing to have for whatever reason. In this case it is needed because CCD is kinda buggy.

Oct 11, 2010 at 3:14 PM
Edited Oct 11, 2010 at 8:52 PM

OK, I'll do that ^^

I also added a new flag : IgnoreStaticCCD. As the name says, it disable CCD only with static bodies (If Isbullet is set, CCD with Dynamic or Kinematic bodies will be enabled, even if my flag is set), for the given body.

With this flag, you can use CCD only with non-static bodies ^^

FP is not referenced in the C# port forum of Box2D O_o

I mean, there is no dedicated thread for FP

Oct 11, 2010 at 8:53 PM

So is there no way to implement wheels on a vehicle in FP3 without disabling CCD?

I am seeing similar problems, here is a demo:

If you drag the car back and forth with the mouse, notice the joints kind of "snag" on the ground and move around.

Sometimes I see similar problems with the rag doll but for some reason it's not as bad.

Should I be trying to tweak friction, mass, etc. to get by this? Or am I going to just "spin my wheels" on this (lol)

Oct 11, 2010 at 9:27 PM

My car is moved by the weels (like a real ^^) so I haven't tried to change friction or mass.

I have very good results with my IgnoreStaticCCD. The weels doesn't snag anymore and I haven't "tunneling" problems because I set "Isbullet" on them. This way the CCD is enabled between the weels and all Dynamic bodies, but not with the ground because it's Static.

No snag and no tunnel! Finally! (lol)

Oct 11, 2010 at 9:29 PM

Would you mind posting your modifications here?

They sound relatively simple but it might save me some time!


Oct 11, 2010 at 9:57 PM

I don't have the sources here. (I should have them Wednesday, 'cause I have a day off tomorow).

But I put the binaries here :

Just replace the one you use (make a backup ^^) and you should see the new properties in the iItelliSense.

Oct 11, 2010 at 11:32 PM

@AndyBeaulieu - It is a known issue with the current CCD implementation. Newer revisions of Box2D should fix this, I've just not had the time and resources to port over the changes.

Oct 12, 2010 at 12:37 AM

No problem, thanks for the great work and help!