Design and Implementation of a Modular C++ Engine for Physical Simulations

Tools used: C++, Qt, OpenGL

  • Developed a physics simulation engine in C++ to model the motion of spinning tops (toupies) in 3D using object-oriented programming.
  • Designed modular classes with encapsulated data, accessors, and overloaded operators.
  • Built an abstract base class, which was extended by multiple specific spinning top models to support different physical simulations.
  • Implemented three numerical integrators (Euler-Cromer, Runge-Kutta, Newmark) using a polymorphic base class with a pure virtual method.
  • Leveraged polymorphism to decouple physics models from integration methods and drawing mechanisms.
  • Used dynamic memory management with unique_ptr to safely manage polymorphic objects and ensure proper resource cleanup.
  • Developed a drawing abstraction with interfaces, allowing rendering via Qt/OpenGL.
  • Built a real-time graphical interface with Qt and OpenGL to visualize toupie motion, using realistic 3D shapes and motion trails.
  • Added simulation optimization features including automatic adjustment of time steps and frame rate control.
  • Created a flexible configuration system allowing simulation setup (toupies, parameters, display) via external files without recompilation.
  • Wrote unit tests for vectors, matrices, integrators, and systems to ensure correctness and modularity.
  • Collaborated in a team of two, using Git and weekly planning to track development progress and debug issues.