# Physics Simulation Forum

 All times are UTC

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Simulating attraction between large objects.Posted: Sat Nov 24, 2007 5:16 am

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

 Post subject: Re: Simulating attraction between large objects.Posted: Tue Nov 27, 2007 5:11 pm

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

 Post subject: Re: Simulating attraction between large objects.Posted: Tue Nov 27, 2007 10:10 pm

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

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 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 forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities