PHYS.ENG (3D Physics Engine)

  • Release: 2010
  • Platform: PC
  • Team: Individual (1 person)
  • Built using:
    • C++
    • OpenGL 2.0 (GLUT)
    • GLSL

Phys.Eng is the final iteration of my 3D physics engine. It offers 3D rigid-body simulation with collision detection and resolution. The physics uses impulses to calculate the positions and velocities of each object, while the object’s rotation is determined using Quaternions and angular velocity calculations.

The engine supports the simulation of boxes and spheres in a 3D world, with semi-stable box stacking ability. Friction calculations also give life to the spheres, allowing them to roll around realistically and spin upon collision, as well as providing traction for moving boxes.

Rendering was handled by my OpenGL 3D graphics engine.

Features of the physics engine includes:

  • 3D rigid-body simulation
  • SAT collision detection
    • Oriented Bounding Boxes (OBB)
    • Spheres
  • Impulse-based collision resolution
  • Quaternion-based rotations
  • Friction
  • Bounding-volume broad-phase culling
  • Pause and frame-step
  • Debug view of collision points & collision normals

The video below is a demonstration of the physics engine. The camera centers around one of the objects, which is controllable by the user who can apply forces to the object in any direction using WASD on the keyboard.

Many of the calculations in my physics engine were based on calculations found in the book Real-Time Collision Detection by Christer Ericson, which is a fantastic resource for game development physics.

Leave a Reply

Your email address will not be published. Required fields are marked *