The Physics Engine of Unity 3D
What is Unity 3D 3
What is a Physics Engine 3
Physical variables 4
rigid bodies 5
collision detection 6
cloth & hair 9
Nvidia PhysX 10
What is Unity 3D?
Unity 3D is a multiplatform game engine. With Unity3D you are able to develop games for PC, Web, Xbox360, Playstation3, Wii and all mobile devices (e.g. iOS, Android and Windows Phone 8).
The Unity Game Engine is used by a lot of developers because it has a lot of features and it is
pretty easy to handle.
Unity 3D is downloadable for free but can be upgraded to Unity Pro which ...view middle of the document...
More broadly, it is the general analysis of nature, conducted in order to understand how the universe behaves."
The Physics is roughly subdivided into the following parts:
- atom & nuclear physics
- relativistic mechanics
- quantum mechanics
Obviously not all parts that are mentioned here are actually used or needed for the physics engine of a computer game. If for example the law of thermodynamics would be used in computer games most of the laser weapons would not be possible because of the heat they would produce.
The quantum mechanics, atom & nuclear physics and the electrodynamics are also generally not used in computer games.
The relativistic mechanics are normally also not used in computer games. If you would use them, it would last way too long to travel from point to point in a space simulation for example.
Optical Effects in a game are normally calculated from the graphics engine and are not part of the physics.
The acoustics or the "game sound" are generally calculated from the game engine itself and are also not part of the physics engine.
So the last part that is left is the mechanics. If we talk about a physics engine we generally refer to the mechanics.
In a modern physics engine the following physical variables are integrated:
- moment of torque
- angular momentum
- angular Velocity
- center of gravity
All of these physical variables are saved for every ingame asset and build the base for simulations.
The most important task for a physics engine is the equation of motion. It defines in which place an object is in a specific time.
Every physics engine is of course different in its features and ways to calculate everything, but however there are some basic techniques, that every physics engine can handle.
- rigid bodies
- collision detection
- cloth & hair
rigid bodies are for example:
- polygon nets
Every Element, that is important for the physics engine is built out of a rigid body. Like I mentioned before, every element that is used to build the game world has its own physical variables (e.g. force, place or velocity) saved.
Collision detection starts to take place when at least two rigid bodies begin to overlap.
If the physics engine would scan the original rigid bodies, it would take way too much computing time to calculate how the objects interact with each other. Therefore the physics engine simplifies the geometry of a rigid body in different ways.
1. Axis aligned bounding box
This is the easiest and fastest but also imprecise method to simplify the rigid bodies. A cuboid, parallel to the world axis is placed around the object. For the collision detection only the cuboid is calculated.