Combinig Bullet with high frequency custom dynamics simulation

Started by
1 comment, last by bmarci 7 years, 5 months ago

Hello,

It might have been asked earlier, but the question is not answered yet.

I have a hobby vehicle simulation I've been doing in my free time and now I have some spare time to work with that again.

The main situation:

My simulation is running at 1000Hz

I use a custom swept-box collision with the environment, that is not satisfactory, sometimes inaccurate and not fast, it's ok for one car though.

I started playing around with bullet (again) and wondering if it could be used for collision and simulating other rigid bodies.

My concerns:

The bullet (and all other physics engines) run on low frequency 60Hz usually.

My suspension and tire simulation needs higher frequency therefore the car's body must also be updated 1000times a second.

And the problem is, it needs to collide with the environment, the other cars, and occasionally dynamic environment objects.

I tried setting the internal timestep of bullet to 1000Hz, but that way a bunch of boxes and convex hulls ate up most of my cpu time, so that's not an option.

I also tried having a "dummy" dynamic object with no gravity that is updated according to my simulation (setting transform, linear and angular velocity that I calculated)

It worked "somehow" but the collision response was weird and also sometimes it sank into static geoms and occasionally went through them.

The kinetic body works "perfectly", but it doesn't collide with the environment also the dynamic bodies are just pushed away regardless of their mass. So, also useless.

I'm also thinking of not modifying the bullet's body directly but adding forces/impulses to translate it to the position that I calculated. I'm not sure if it could work.

So, does anybody here have any experience with this kind of issue?

I read about ghost objects, but it's quite hard to find usefull info on how to use them for this kind of purpose.

thanks in advance for any help or idea.

Advertisement

You may wanna look at Newton Game Dynamics as well:

I have used it at 300 Hz without issues (but you may need to change a define to allow it).

It has far better accuracy and robustness. (Reason for me to switch from Bullet to Newton even at times when it was closed source.) Performance is comparable with the big ones.

It has very advanced and fast Vehicle simulation (WIP in combination of a new feature to solve stiff non cyclic joint graphs).

It has CCD and you can use it for collision detection only.

I'm also thinking of not modifying the bullet's body directly but adding forces/impulses to translate it to the position that I calculated. I'm not sure if it could work.

This should work. I've used this approch for powered ragdolls but later replaced the idea with Newtons joints (can set target acceleration, max torque etc.) which worked much better with 60Hz than my crap with 300 Hz.

Hi,

This should work. I've used this approch for powered ragdolls but later replaced the idea with Newtons joints (can set target acceleration, max torque etc.) which worked much better with 60Hz than my crap with 300 Hz.

Great, meanwhile I found your other post regarding this issue, and managed to bring it to live in my code :)

It has a bit of oscillation, but with reasonable threshold that can be "neglected".

thanks for the hint!

This topic is closed to new replies.

Advertisement