Register to reply

C++ Text Geared Toward Physics Engines?

by Saladsamurai
Tags: engines, geared, physics, text
Share this thread:
Feb27-12, 07:27 PM
Saladsamurai's Avatar
P: 3,016
Does anyone know of any good texts that are geared towards creating Physics Engines using c++? Or at the least, a text on creating physics engines in general? Any personal recommendations would be great.
Phys.Org News Partner Science news on
'Smart material' chin strap harvests energy from chewing
King Richard III died painfully on battlefield
Capturing ancient Maya sites from both a rat's and a 'bat's eye view'
Feb27-12, 09:45 PM
HW Helper
P: 7,176
In the case of a physics engine for a game, current conditions such as position, velocity, and control inputs are used to calculate accelerations, then numerical integration is used to calculate a new velocity and position, based on some time step. The numerical integration is fairly straight forward. Collision handling can be tricky. For a game that tries to emulate reality, the difficult part is creating a mathematical model for the objects in a game, such as tires and suspension on a car, aerodynamics on a plane, ... . Most physics engines run at some fixed rate, but I don't know what is used to control the timing on a PC for rates that aren't multiples of 1 milli-second (a common timer) such as 360hz (versus 333hz).
Feb27-12, 11:59 PM
P: 4,578
Quote Quote by Saladsamurai View Post
Does anyone know of any good texts that are geared towards creating Physics Engines using c++? Or at the least, a text on creating physics engines in general? Any personal recommendations would be great.
There is a text by O'Reilly that covers this in a little detail:

But you will need to do a lot on top of reading just this alone.

You have to understand issues about numerical integrators to see when things blow up and go unstable and also need to understand any 'hacks' that are put in to stop stuff like this from happening.

Also on top of this understand geometry in a very detailed manner.

The reason is that numerical integrators are good for the 'response' part but for the 'detection' part you need collision primitives and this is a whole other kettle of fish.

Also it's not just static, you will want your scene spatially organized and any kind of dynamic information like momentum (angular and non-angular) need to be taken into account with the spatial classification that is assigned.

If you want a basic idea of spatial classification then the simplest one is the BSP tree which basically keeps dividing the space in half with each plane.

It's not the best way but there are a lot of approaches to spatial classification and its important that you realize that the classifier doesn't have to be straight, and you could even use a specialized data structure and a 'search' algorithm to do some funky stuff.

But yeah aside from 'response' (integration issues, function definition etc) and 'detection' (collision and everything else), then you need 'games' specific stuff because games are not realistic and sometimes you want to have 'wacky' effects that are clearly not real.

After you combine these three then you get a physics engine that allows a template for collision detection and response and that allows you to tweak specific variables to implement 'physics models' which include things like gravity, dampening coeffecients and other things.

If you can get some open source game engine specific physics engines you will see what I mean when I say the things I say in my post.

Feb28-12, 07:24 PM
Saladsamurai's Avatar
P: 3,016
C++ Text Geared Toward Physics Engines?

This is great info chiro. Thanks for the reply.
Nov26-12, 12:21 PM
P: 723
I have played around with this game engine some, last year. It is pretty cool.


Register to reply

Related Discussions
DC geared motor Engineering, Comp Sci, & Technology Homework 0
High school student (and prospective physics major) looking for rigorous physics text Science & Math Textbooks 7
First-year physics text shoutout [Physics - Ohanian, 2nd Edition] Science & Math Textbooks 0
Geared turbofans for large engines Mechanical Engineering 15
Physics of scramjet engines. Aerospace Engineering 4