Hi all,
as I haven't found a welcome thread, I'll jump directly into my first question, but not before saying thank you for bullet. Also I want to mention that I'm new to bullet, so please be forgiving if my question(s) are too stupid or answered somewhere else in the forum.
I want to use bullet for an IOS project. I just copied (some, not all) folders directly into my XCode project, and everything seems to work fine and I got my scene up and running. I'm throwing in a couple of boxes (or cylinders, or multisphereshapes) with friction (and rolling friction) and they do what they are expected to do, and after a while they stack up nicely and fall asleep. So far, so good.
Then I wake up one body (btrigidbody->activate()) and, of course, some others wake up, too. But, they start moving again instead of beeing in a stable rest. (Also, when I set the sleeping thresholds to zero they don't fall asleep and "never" stop moving)
For my project it's crucial that they are really in a stable rest state and don't move (unless they collide, loose a resting contact, get forces applied to, ...). Is there a way to achieve this? A threshold to really prevent moving? A workaround for this phenomen?
I hope my question is clear enough to get answered, or to help me to get into the right direction where to "tweak" bullet.
Thanks in advance,
ankh
Stable resting contact after waking up
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Stable resting contact after waking up
Can you try using the latest SVN checkout, instead of Bullet 2.81?
There are many factors that can cause jittle, here are a few things to try:
Use a small internal timestep, such as world->stepSimulation(dt,10,1./240.);
Avoid very small shapes, smaller than 0.2 units.
Use the default collision margin, (0.04)
Use btBoxShape for moving boxes and the ground, just to test if that makes the simulation more stable.
Increase the inertia tensor, by multiplying it with some small factor: box->calculateLocalInertia(mass,inertia); inertia*=2.f;
Use gravity (0,-10,0), not larger than that.
Use 2 friction directions: dynamicsWorld->getSolverInfo().m_solverMode |=SOLVER_USE_2_FRICTION_DIRECTIONS;
Use zero restitution
Use more solver iterations: dynamicsWorld->getSolverInfo().m_numIterations = 20;
Hope this helps,
Erwin
There are many factors that can cause jittle, here are a few things to try:
Use a small internal timestep, such as world->stepSimulation(dt,10,1./240.);
Avoid very small shapes, smaller than 0.2 units.
Use the default collision margin, (0.04)
Use btBoxShape for moving boxes and the ground, just to test if that makes the simulation more stable.
Increase the inertia tensor, by multiplying it with some small factor: box->calculateLocalInertia(mass,inertia); inertia*=2.f;
Use gravity (0,-10,0), not larger than that.
Use 2 friction directions: dynamicsWorld->getSolverInfo().m_solverMode |=SOLVER_USE_2_FRICTION_DIRECTIONS;
Use zero restitution
Use more solver iterations: dynamicsWorld->getSolverInfo().m_numIterations = 20;
Hope this helps,
Erwin
-
- Posts: 3
- Joined: Thu Sep 26, 2013 11:49 am
Re: Stable resting contact after waking up
So do I. Thank you for the list. Some of those points I have already tried, but surely not all of them. I'll let you know of my progress...Erwin Coumans wrote:Hope this helps,
Erwin
Thanks,
ankh
-
- Posts: 3
- Joined: Thu Sep 26, 2013 11:49 am
Re: Stable resting contact after waking up
I followed the list by the book and it's stable now, or at least stable enough for my needs 
As far as I can tell those steps had the most influence:
btdynamicsworld->getSolverInfo().m_solverMode |= SOLVER_USE_2_FRICTION_DIRECTIONS;
increasing the timestep to 1.0f/240.0f (from 1.0f/120.0f)
Bad news is, that I'm now running into performance problems at 60hz refresh rate, but I believe I will find ways to solve this and to make it less noticeable for the user. Also I still have to fine-tune everything and maybe I can reduce the calculation cost a little further. By the way, the SVN version 2.82 seems to be already a lot faster than the "official" 2.81 version. Nice.
I have to play around with this a little. Also I already have some more questions on how to possibly optimize some parts of bullet for my special needs, but those wouldn't belong into this topic and I will have a look first, if they are already answered somewhere else here.
Thanks for the heads up up start
ankh

As far as I can tell those steps had the most influence:
btdynamicsworld->getSolverInfo().m_solverMode |= SOLVER_USE_2_FRICTION_DIRECTIONS;
increasing the timestep to 1.0f/240.0f (from 1.0f/120.0f)
Bad news is, that I'm now running into performance problems at 60hz refresh rate, but I believe I will find ways to solve this and to make it less noticeable for the user. Also I still have to fine-tune everything and maybe I can reduce the calculation cost a little further. By the way, the SVN version 2.82 seems to be already a lot faster than the "official" 2.81 version. Nice.
I have to play around with this a little. Also I already have some more questions on how to possibly optimize some parts of bullet for my special needs, but those wouldn't belong into this topic and I will have a look first, if they are already answered somewhere else here.
Thanks for the heads up up start

ankh