Update to 2.75, physics no more working at all
-
- Posts: 198
- Joined: Mon Sep 04, 2006 5:31 pm
- Location: Switzerland
Update to 2.75, physics no more working at all
As the title said updated to 2.75 from 2.73 and now physics are no more working. All objects stay in place like there exists no physics at all. To hunt down the problem can you tell me if something specific changed from 2.73 to 2.75 which can potentially break the physics simulation? Like something important or of large scale which can bite you in the butt? It's just very hard to find the problem in large code which worked which suddenly totally breaks without a direction to look for the problem to narrow down the code part to sift through.
-
- Posts: 198
- Joined: Mon Sep 04, 2006 5:31 pm
- Location: Switzerland
Re: Update to 2.75, physics no more working at all
I think I know now what's going on. Back then I had to hack my own btDiscreteDynamicsWorld::addRigidBody since the existing call has undesired side effects. Now you changed these functions to store objects in an additional list which did not carry over. I don't know yet how to solve this since the new addRigidBody has still one of the undesired side effects left while the others are gone. The problem is that in that call you mess with the gravity and this interferes with my code. I'll try if it works with a hacked second version removing the side effect.
Would it be possible to add a "pure" addRigidBody which does nothing except adding the object without messing with the state of the provided rigid body?
Would it be possible to add a "pure" addRigidBody which does nothing except adding the object without messing with the state of the provided rigid body?
-
- Posts: 50
- Joined: Thu Jul 09, 2009 1:46 pm
Re: Update to 2.75, physics no more working at all
I'd suggest changing the definition of the addRigidBody function to:
void addRigidBody(btRigidBody* body, bool applyGravity = true)
In the .cpp:
And then just pass mydiscreteWorld->addRigidBody(pointer-to-rb, false);
Cheers,
Simon.
void addRigidBody(btRigidBody* body, bool applyGravity = true)
In the .cpp:
Code: Select all
void btDiscreteDynamicsWorld::addRigidBody(btRigidBody* body, bool applyGravity)
{
if (!body->isStaticOrKinematicObject() && applyGravity )
{
body->setGravity(m_gravity);
}
...
Cheers,
Simon.
-
- Posts: 198
- Joined: Mon Sep 04, 2006 5:31 pm
- Location: Switzerland
Re: Update to 2.75, physics no more working at all
I currently solved it by simply commenting out the gravity call inside addRigidBody as I don't need it inside this call anyways. But maybe your proposition could be added to bullet as a patch so it is available in the future for all of us.
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Update to 2.75, physics no more working at all
Good suggestions. Can you report them in the issue tracker?
http://code.google.com/p/bullet/issues/list
Thanks!
Erwin
http://code.google.com/p/bullet/issues/list
Thanks!
Erwin
-
- Posts: 198
- Joined: Mon Sep 04, 2006 5:31 pm
- Location: Switzerland