C++ Text Geared Toward Physics Engines?

In summary, this text explains how to create a physics engine for a game, and provides a few resources to help you do so. Most importantly, you need to understand collision detection and response as well as spatial organization.
  • #1
Saladsamurai
3,020
7
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.
 
Technology news on Phys.org
  • #2
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).
 
  • #3
Saladsamurai said:
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:

http://shop.oreilly.com/product/9780596000066.do

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 into 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.
 
  • #4
This is great info chiro. Thanks for the reply. :smile:
 
  • #5

1. What is C++ Text Geared Toward Physics Engines?

C++ Text Geared Toward Physics Engines is a programming language specifically designed for creating physics engines. It combines the powerful features of C++ with the necessary tools and libraries for creating realistic physics simulations in games, simulations, and other applications.

2. How is C++ Text Geared Toward Physics Engines different from regular C++?

C++ Text Geared Toward Physics Engines is a specialized version of C++ that includes additional features and libraries specifically for creating physics engines. These features include built-in support for vectors, matrices, and other mathematical operations commonly used in physics simulations.

3. What are the benefits of using C++ Text Geared Toward Physics Engines?

C++ Text Geared Toward Physics Engines offers several benefits for developers, including faster and more efficient code execution, access to powerful math libraries, and the ability to create highly realistic and accurate physics simulations for games and other applications.

4. Do I need to have a strong background in physics to use C++ Text Geared Toward Physics Engines?

While some knowledge of physics can be helpful, it is not necessary to have a strong background in the subject to use C++ Text Geared Toward Physics Engines. The language and libraries are designed to make it easier for non-experts to create physics simulations.

5. Are there any resources available for learning C++ Text Geared Toward Physics Engines?

Yes, there are many online tutorials, courses, and forums available for learning C++ Text Geared Toward Physics Engines. Some popular resources include the official documentation, online communities such as Stack Overflow, and video tutorials on platforms like YouTube.

Similar threads

  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
1
Views
259
  • Programming and Computer Science
Replies
4
Views
335
  • Programming and Computer Science
Replies
9
Views
1K
Replies
4
Views
980
Replies
6
Views
648
  • Programming and Computer Science
Replies
22
Views
2K
  • Programming and Computer Science
Replies
1
Views
971
  • Programming and Computer Science
Replies
6
Views
2K
  • Programming and Computer Science
2
Replies
65
Views
2K
Back
Top