Projects

Box physics

2026

  • C
  • Physics
  • 3D

A lightweight 3D physics engine developed in C as a learning-focused project, centered around simulating rigid body interactions using axis-aligned bounding boxes (AABBs) and simple, optimized collision handling techniques.

The engine was designed to explore the fundamentals of physics simulation from the ground up, including collision detection, response, and integration, while keeping the scope intentionally constrained to box-based primitives. By limiting the problem space, the project emphasizes clarity of implementation and performance-conscious design rather than feature completeness.

At its core, the engine implements a basic simulation pipeline:

Position and velocity integration Broadphase collision checks using AABB overlap tests Narrowphase resolution for box-to-box collisions Impulse-based collision response with simple positional correction

To improve performance, the engine incorporates straightforward optimizations such as spatial locality awareness, early-out collision checks, and minimal data structures to reduce overhead. These optimizations allow the system to handle multiple interacting bodies efficiently while maintaining readable and maintainable code.

The project also explores key concepts in physics engine design:

  • Separation of detection and resolution phases
  • Tradeoffs between accuracy and performance
  • Stability considerations in discrete simulations
  • Data-oriented approaches for small-scale systems

While intentionally limited in scope, the engine serves as a foundational step toward more advanced systems, providing insight into how larger physics engines are structured and optimized. It demonstrates an understanding of core simulation principles and the ability to implement them cleanly and efficiently in a low-level programming environment.