Name: Anonymous 2020-05-25 1:29
The primary purpose of a Physics Engine is to integrate the Equation Of Motions. You may recall them from college as:
Newton's second law:
\( \vec{F}=m\vec{a} \)
Rotational Force (Moments, Torque):
\( \vec{M}=I\vec{\alpha} \)
The integration of the Equation of Motions provides two key parameters the game engine requires to simulate the real world. The two parameters a game engine is interested in are the final velocity and position.
For example, if a force is applied to an object, you can compute the velocity by integrating the acceleration. And you can calculate the position by integrating the velocity.
That’s the primary duty of a physics engine: To integrate the equation of motions.
However, there is a little problem. Computers are not capable of computing an integral. Therefore, you must use Numerical Integration methods. There are some simple methods you can use, such as the Euler Method, but I strongly recommend you use the Runge-Kutta 4th Order Method. It is a bit complicated to implement but provides a better approximation.
So, in a nutshell, what do you need to implement in a Physics Engine? You will need to implement a continuous loop which consists of the following steps:
1. Identify all forces and moments acting on the object.
2. Take the vector sum of all forces and moments
3. Solve the equation of motion for linear and angular acceleration
4. Integrate the acceleration with respect to time to find the Linear and Angular velocity.
5. Integrate the velocity with respect to time to find the linear and angular displacement.
These two books are amazing if you are interested in developing a Physics Engine:
Physics for Game Developers: Science, math, and code for realistic effects: David M Bourg, Bryan Bywalec: 9781449392512: Amazon.com: Books
Amazon.com: Game Physics Engine Development: How to Build a Robust Commercial-Grade Physics Engine for your Game (9780123819765): Ian Millington: Books
Hope this helps.
Newton's second law:
\( \vec{F}=m\vec{a} \)
Rotational Force (Moments, Torque):
\( \vec{M}=I\vec{\alpha} \)
The integration of the Equation of Motions provides two key parameters the game engine requires to simulate the real world. The two parameters a game engine is interested in are the final velocity and position.
For example, if a force is applied to an object, you can compute the velocity by integrating the acceleration. And you can calculate the position by integrating the velocity.
That’s the primary duty of a physics engine: To integrate the equation of motions.
However, there is a little problem. Computers are not capable of computing an integral. Therefore, you must use Numerical Integration methods. There are some simple methods you can use, such as the Euler Method, but I strongly recommend you use the Runge-Kutta 4th Order Method. It is a bit complicated to implement but provides a better approximation.
So, in a nutshell, what do you need to implement in a Physics Engine? You will need to implement a continuous loop which consists of the following steps:
1. Identify all forces and moments acting on the object.
2. Take the vector sum of all forces and moments
3. Solve the equation of motion for linear and angular acceleration
4. Integrate the acceleration with respect to time to find the Linear and Angular velocity.
5. Integrate the velocity with respect to time to find the linear and angular displacement.
These two books are amazing if you are interested in developing a Physics Engine:
Physics for Game Developers: Science, math, and code for realistic effects: David M Bourg, Bryan Bywalec: 9781449392512: Amazon.com: Books
Amazon.com: Game Physics Engine Development: How to Build a Robust Commercial-Grade Physics Engine for your Game (9780123819765): Ian Millington: Books
Hope this helps.