Skip to content

GaganMishra305/physix2d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Physix2D

A lightweight 2D physics engine in C++, built as a learning journey and passion project.


🚀 Getting Started

  1. Build the library: ./build_lib.sh
  2. Create a demo in the examples/src/my_demo folder and build it: ./examples/build_examples.sh
  3. Run your demo: ./build/my_demo


🎥 Demos

in the assets directory

colliding_balls.mp4
bouncing_balls.mp4


✅ Development Roadmap

Phase 1: Core Physics + Visual Debug

  • Vec2 (basic vector math)
  • Body (circle-only: pos, vel, mass, radius)
  • World (gravity + integration loop)
  • DebugDraw (SFML/SDL/OpenGL)
  • Falling ball demo 🌕
  • Rain of balls demo 🌧
  • Bouncing off ground demo ⬇️

Phase 2: Collision Detection + Resolution

  • Shape base class
  • CircleShape, PolygonShape
  • Collision detection (circle–circle, polygon–polygon)
  • Contact manifold
  • Simple solver (impulse resolution)
  • Ball pit demo ⚪
  • Box stack demo 📦
  • Domino chain demo 🧱
  • Ball inside box demo 🏀

Phase 3: Joints & Constraints

  • Joint base class
  • RevoluteJoint, DistanceJoint
  • Island solver
  • Pendulum demo 🔗
  • Rope bridge demo 🌉
  • Ragdoll demo 🕺
  • Newton’s cradle demo 🪀

Phase 4: Advanced Collisions (Broad Phase + CCD)

  • Broad-phase (dynamic tree, sweep & prune)
  • Continuous collision detection (TOI)
  • Bullet through stack demo 💥
  • Loop track demo 🎢
  • Stress test with thousands of objects 🌊

Phase 5: Particles & Fluids

  • Particle + ParticleSystem
  • Particle contacts
  • Water fountain demo 💧
  • Sand pile demo 🏖
  • Smoke effect demo ☁️
  • Liquid in a box demo 🌊

Phase 6: Soft Bodies (Rope, Cloth, Deformables)

  • Rope, RopeJoint
  • SoftBody, Cloth
  • Rope swing demo 🪢
  • Flag in wind demo 🏴
  • Jelly cube demo 🍮
  • Cloth + fluid interaction demo 🌊

Phase 7: Polishing + Showcase

  • World callbacks (begin/end contact)
  • Profiler & memory manager
  • Mixed scene demo 🎮
  • Destructible bridge demo 🏗
  • Tornado effect demo 🌀

BONUS: Advanced Simulations -

  • Clothe simulation
  • Fluid simulation
  • Smoke simulation

About

Physix2d is a simple deterministic physics engine.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published