A 2D physics engine in ANSI C.
mkdir build
cd build
cmake ..
make -j
TheBox [simulation file]
Simulation files control the behaviour of the program. The repository contains a simple simulation example in simulation.txt.
The syntax is as follows:
simulation [nobj] [timestep] [gravity]: Creates a simulation withnobjobjects, sets the gravity togravityand the time interval between frames astimestep.window [width] [height] [bpp] [scale] [quality]: Creates a window of sizewidthxheightandbppbits per pixel, sets the view scale toscaleand rendering quality toquality(between 5 and 100).shape [restitution] [friction] box [half width] [half height]: Creates a box with size 2*half widthx2*half height, and sets itsfrictionandrestitution.shape [restitution] [friction] circle [radius]: Creates a circle with radiusradius, and sets itsfrictionandrestitution.object [shape index] [flags] [mass] [x] [y] [angle] ([x speed] [y speed] [angular velocity]): Creates an object with the shape indexed byshape index(starting from 0), the given flags (STATIC=1, SLEEPING=2),mass,position, andvelocity.