2D physics engine for simulation & Reinforcement Learning Environment.
- Simple and basic Physics Engine 2D Simulator.
- Simulator for Reinforce Learning or other Physical Environment Analysis.
- Link to python RL (e.g. Gymnasium) library using Pybind11.
- Ubuntu 20.04 LTS
- g++
- Qt5
- OpenGL
sh dependencies.sh
cd ./src
cmake CMakeLists.txt -B build
cd build
make physics
Chain (revolute joint)
Free fall
Cart Pole
snake
- Physics Simulation
- Basic Dynamics, Collision, Joint physics operation.
- Step by Step physics simulate.
- Pause / Restart simulation.
- Change some physics pipeline property
- Velocity Collision Iterator.
- Position Collision Iterator.
- Velocity JointIterator.
- Velocity Joint Iterator.
- C++ physics info --> python window.
cartpole
snake
- Support Reinforcement Learning Library (Gymnasium) link.
- Pybind11 binding.
- simulator
# run physics simulator GUI
cd build/src
./physics
- RL env
# run gymnasium environment
cd python/src/envs
python run.py
- RigidBody Dynamics
- Apply Force.
- Velocity Calculation.
- Position Calculation.
- Collision Detection
- GJK algorithm for detect collide or not.
- EPA algorithm for collision information (how deep?, which direction?).
- Clipping algorithm for collision manifolds (where is collision points?).
- Collision Handle, Joint Handle
- Constraint method.
- All collision, joint, frictions are regarded as constrained condition.
- Dynamics equation should fulfill constrained dynamics.
- Iteration
- For fast, stable body simulation.
- Re-Calculate for all physical objects.
- Constraint method.
- Qt
- GL
- Pybind11
- class diagram
- Function
- Interfere physics module, add command and apply.
- Accept command from User, external modules.
- New Version
- 3D Physics Engine