Building a Physics Engine: Input on how things should be done?

Started by
3 comments, last by xsirxx 19 years, 6 months ago
This is a basic idea thread relating to Physics engines. I currently have physics in my game and I place them in areas where each entity relys on that certain physics. So the question is, How do you build your physics engines? Do you place them in a class on its own? How do you arrange each relation? How do u extract what you need? --I ask this because Im looking at rebuilding my engine but I want a robust easy to modify and easy to reuse for other games type of setup. Say you were to make a sequel with a new engine but want same physics...? So general Ideas on how you do yours would be REALLY appreciated! Thanks much. --Brad
--X
Advertisement
A good idea is to look at others physics engine interface.
Have a look at
- ODE http://ode.org/
- Tokamak http://www.tokamakphysics.com/
- MrRowl work http://www.rowlhouse.co.uk/jiggle/index.html
for exemple
What you could do is create a chart. Start with the main part; physics. Then break it down to more specific areas like natural physics like gravity and unnatural physics like objects.
Yeah definately take a look at ODE. Check out the tutorials to understand how ODE's interface works.

Btw if you are planning to write your own complete full scale physics engine (simulator), don't bother unless you have a lot of time on your hands. Just use ODE or any other ones. If you are just making a simple one than you should be fine.
Well I have never used another physics engine, So yea im only going to write what is essential to my game. I have alot of code in already for flight model and projectile and so fourth... Yet Its kind of cluttered, they are placed in each area's own physics section. So my idea was to put it all together, and with what some of you said was place the gravity stuff you will use alot together, that makes since. Ill think about it some more, just wondering what the majority has done. Whats the best idea if you dont want to use someone else's physics. Thanks,

--Brad
--X

This topic is closed to new replies.

Advertisement