Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Update to 2.75, physics no more working at all
PostPosted: Thu Dec 24, 2009 10:49 am 
Offline
User avatar

Joined: Mon Sep 04, 2006 5:31 pm
Posts: 125
Location: Switzerland
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.

_________________
Image
Leader, Head Programmer: Project Epsylon | Drag[en]gine Game Engine | ModDB Profile


Top
 Profile  
 
 Post subject: Re: Update to 2.75, physics no more working at all
PostPosted: Thu Dec 24, 2009 11:38 am 
Offline
User avatar

Joined: Mon Sep 04, 2006 5:31 pm
Posts: 125
Location: Switzerland
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?

_________________
Image
Leader, Head Programmer: Project Epsylon | Drag[en]gine Game Engine | ModDB Profile


Top
 Profile  
 
 Post subject: Re: Update to 2.75, physics no more working at all
PostPosted: Mon Dec 28, 2009 9:46 am 
Offline

Joined: Thu Jul 09, 2009 1:46 pm
Posts: 45
I'd suggest changing the definition of the addRigidBody function to:
void addRigidBody(btRigidBody* body, bool applyGravity = true)

In the .cpp:
Code:
void   btDiscreteDynamicsWorld::addRigidBody(btRigidBody* body, bool applyGravity)
{
   if (!body->isStaticOrKinematicObject() && applyGravity )
   {
      body->setGravity(m_gravity);
   }
...


And then just pass mydiscreteWorld->addRigidBody(pointer-to-rb, false);

Cheers,
Simon.


Top
 Profile  
 
 Post subject: Re: Update to 2.75, physics no more working at all
PostPosted: Mon Dec 28, 2009 11:22 am 
Offline
User avatar

Joined: Mon Sep 04, 2006 5:31 pm
Posts: 125
Location: Switzerland
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.

_________________
Image
Leader, Head Programmer: Project Epsylon | Drag[en]gine Game Engine | ModDB Profile


Top
 Profile  
 
 Post subject: Re: Update to 2.75, physics no more working at all
PostPosted: Wed Dec 30, 2009 2:50 am 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3126
Location: California, USA
Good suggestions. Can you report them in the issue tracker?
http://code.google.com/p/bullet/issues/list

Thanks!
Erwin


Top
 Profile  
 
 Post subject: Re: Update to 2.75, physics no more working at all
PostPosted: Wed Dec 30, 2009 1:36 pm 
Offline
User avatar

Joined: Mon Sep 04, 2006 5:31 pm
Posts: 125
Location: Switzerland
Done so.

_________________
Image
Leader, Head Programmer: Project Epsylon | Drag[en]gine Game Engine | ModDB Profile


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot], MSN [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group