Custom Physics Engine

Portfolio Image
Portfolio Image
Portfolio Image
Portfolio Image
Portfolio Image
Portfolio Image

Information

  • Genre: Physics Engine
  • Platform: PC
  • Engine: Unity 3D
  • Duration: 5 months • October/March 2025 • Alongside other projects
  • Team Size: 2 members
  • Role: Programmer
  • Skills: C# Unity Physics Architecture Dynamic AABB Tree Rigidbody

Pitch

Physics Engine is a project focused on implementing the different parts of a Physics Engine, such as the Broad Phase, the Narrow Phase, and collision responses.

• The Broad phase is responsible for detecting which colliders can possibly collide against each other. We created a Dynamic AABB Tree for this part to optimize our simulation, as it will only test AABB intersection between colliders that might collide.
This avoids performing the real collision detection algorithm between every collider, which would cause performance issues.
In this phase, collision detection is only made with AABBs encapsulating our objects.

• The Narrow Phase is responsible for testing whether the collider pairs given by the broad phase are really colliding. For this phase, we created our custom collider classes (Sphere, Cube, and Mesh) and implemented the GJK (Gilbert-Johnson-Keerthi algorithm) algorithm for collision testing, and implemented the EPA (Expanding Polytope Algorithm) to compute collision data needed for the resolution.

• Finally, the last part we implemented was the collision response physics.

• Additionally, we also implemented a custom rigidbody using the Semi-Implicit Euler integration and functions such as AddForce(), AddTorque() with different Force Types such as Force, Acceleration, Impulse, and VelocityChange. We also added physics material.


My Tasks

  • Implemented the Dynamic AABB Tree
  • Developed the EPA algorithm to find collision contact points and normal.
  • Implemented the rigidbody and colliders system
  • Code Architecture with an UML
  • Debug
  • Wrote technical documentation