Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sat Nov 24, 2007 5:16 am 
Offline

Joined: Sat Nov 24, 2007 5:06 am
Posts: 1
Hi,

I'm looking to build a basic simulation of a planetary system. Therefore I need to know if Bullet can calculate forces of attraction between large bodies.

I've scanned through the SDK, FAQ, DOCS and this forum but cannot find if Bullet will help me with this.

If it cannot does anyone on this forum have any suggestions of an open source physics library that will? I've written my own but it's not efficient and does not scale well with hundreds of objects.

Best regards,

Pete.


Top
 Profile  
 
PostPosted: Tue Nov 27, 2007 5:11 pm 
Offline

Joined: Tue Feb 20, 2007 4:56 pm
Posts: 179
I doubt there's any native support for calculating this force, but it's easy to add the forces yourself.

Newton's Law of Universal Gravitation:

Force = G * m1 * m2 / r^2

G is the universal gravitational constant (6.67 × 10^?11 N m2 kg?2)
m1 is the mass of the first object (kg)
m2 is the mass of the other object (kg)
r is the distance between the objects (in meters)


Top
 Profile  
 
PostPosted: Tue Nov 27, 2007 10:10 pm 
Offline

Joined: Mon Jul 02, 2007 5:12 pm
Posts: 145
Hi,

One word of warning when doing something like this. I would recommend changing the value of gravity for the smaller bodies to be affected by the larger body, rather than adding the gravitational force as an external force (ie: body->addForce() ). The reason is that if you use the latter method, it is reliant upon your framerate. I was trying to simulate wind acting on a body, and I until I changed the gravity on the body to be (VEC3(0, -10, 0) + WindSpeed) my results would be inconsistent because my framerate was not constant.

You can easily update this each frame, same as you would need to if you were applying a force, so it shouldn't change your implementation much.

- Alex


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 4 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® Forum Software © phpBB Group