Pegasus is a cross-platform C++ game physics engine that is written with the data-oriented design in mind with minimum external dependencies (GLM and SPDLog). The aim of this project is to implement a robust, modern and simple to use API for game physics computations. The main motivation to write this engine was curiosity and desire to write physics code that utilizes a modern approach to software development, such as cache friendly code, high parallelization ability (CPU and GPU with CS), robust memory management with model C++ standard versions.
Tested on Ubuntu 16.04.
-
Install essential components:
sudo apt-get install build-essential git cmake gcc g++
-
Install dependencies:
sudo apt-get install freeglut3 freeglut3-dev libglew1.5 libglew1.5-dev libglu1-mesa libglu1-mesa-dev libgl1-mesa-glx libgl1-mesa-dev libxtst-dev xvfb libxmu-dev libxi-dev libxinerama-dev
-
Clone and initialize:
git clone [email protected]:Godlike/Pegasus.git && cd Pegasus
git submodule init && git submodule update --init --recursive
-
Build:
mkdir build && cd build && cmake .. && make && chmod +x ./output/PegasusPhysics
-
Run the demo:
./output/PegasusPhysics
Tested on Windows 10 VS 2017.
- Download GitHub Windows client
- Clone repository with the application from
[email protected]:Godlike/Pegasus.git
- Download CMake GUI for Windows
- Create a Visual Studio Project using CMake GUI
- Open the solution in VS, build it and run
PegasusDemo
project.
Tested on Mac OS High Sierra.
- Install CMake
- Install Git
- Clone and initialize:
git clone [email protected]:Godlike/Pegasus.git && cd Pegasus
git submodule init && git submodule update --init --recursive
- Build:
mkdir build && cd build && cmake .. && make && chmod +x ./output/PegasusPhysics
- Run the demo:
./output/PegasusPhysics
Plane
Box
Sphere
Collision detection is handled using custom implementations of Jacobi Eigenvalue, Quickhull Convex Hull, Half-Edge Data Structure, CSO, GJK and EPA algorithms.
Collision resolution is based on the constraint collision model and implemented using such techniques as Sequential Impules, Restitution Slop, and Warm Starting to help improve overall stabity of the system.
Pegasus provides an API for creation of Dynamic and Static rigid bodies. Creating new simulation is as simple as creation new Scene
object, and population of the new Scene
could be peformd trought high-level OOP based API or trough low level Functional handle-based API, which provides developer with the flexibily when performas is needed.
- Discrete collision detection
- Primitives: Plane, Ray, Sphere, Box
- Intersection, Contact normal, Penetration depth, Contact point calculation (GJK, EPA)
- Bounding sphere, AABB, OBB
- Ray tracing
- Static rigid bodies
- Dynamic rigid bodies
- Stable stacking
- Constraint-Based resolution
- Static bodies
- Dynamic bodies
- Linear motion
- Force generators
- Object groups
- Angular motion
- Friction
- Swept sphere based continuous collision detection
- Primitives: Triangle, Cone, Cylinder, 8-DOP, Convex hull
- Sphere tree, AABB tree, OBB tree, 8-DOP tree, Convex Hull tree
- Space partitioning tree
- Narrow phase collision detection
- Broad phase collision detection
- Compound geometries
- Island based sleeping
- The time of impact
- Constraints
- Kinematic bodies
- Impulse generators
- Soft Body Physics
- Liquids Physics
- Gases Physics
- Clothes Physics
- Ragdolls