Jump to content
  • Advertisement
Sign in to follow this  
lucky6969b

How to make the bullet physics update faster?

Recommended Posts

My bullet physics simulation works very slowly. Let's say, one of the objects is lifting the other one, the takes many many many frames to update to the correct position. Just very laggy...

Can I increase the dt? or decrease it, to make the physics react better?

 

The fact is I use the gimpact shapes for the forks of the forklift, I can't decompose the forks into many boxes, it's too time consuming...

So I have one 4 bvh static mesh, 8 gimpacts, about 10 boxes...

Thanks

Jack

 

	l_dynamicsWorld->stepSimulation(dt,100,dt/100);
	
Edited by lucky6969b

Share this post


Link to post
Share on other sites
Advertisement

This looks to me as if you are taking 100 sub-steps per tick which would indeed be very slow. Usually you pick a fixed time-step like 30, 60, 120, or even 240 Hz and a fixed number of sub-steps. For games 30 or 60 Hz is a typical choice. 

const int MaxSubSteps = 4
const float FixedTimeStep = 1.0f / 60.0f; // Or similar

pDynamicsWorld->stepSimulation( dt, MaxSubSteps ,FixedTimeStep );

I recommend checking out Glenn's post here:

https://gafferongames.com/post/fix_your_timestep/

And the Bullet Wiki:

http://bulletphysics.org/mediawiki-1.5.8/index.php/Stepping_The_World

You also posted a bunch of other questions regarding dynamic mesh shape (GImpact) collision. This is usually slow since this is just a very difficult problem. I would not use GImpact shapes in real-time simulations. Use simple hulls or compounds instead.

Edited by Dirk Gregorius

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!