|
Fireset
|
Simple 2D physics simulation module. More...
Classes | |
| struct | FsBody |
| Physics body. More... | |
| struct | FsSpace |
| Physics simulation space. More... | |
Enumerations | |
| enum | FsBodyType { FS_BODY_QUAD , FS_BODY_CIRCLE } |
| Physics body types. More... | |
Functions | |
| FsSpace | fsSpaceCreate (FsVec2 gravity, FsVec2 damping) |
| Creates a physics simulation space. | |
| void | fsSpaceAddBody (FsSpace *space, FsBody *body) |
| Adds a body to a physics space. | |
| void | fsSpaceStep (FsSpace *space, float stepTime) |
| Advances the physics simulation. | |
| bool | fsIsQuadColiding (FsBody quad1, FsBody quad2) |
| Checks collision between two quad bodies. | |
Simple 2D physics simulation module.
| enum FsBodyType |
Checks collision between two quad bodies.
Performs an axis-aligned bounding box (AABB) collision test. Only bodies of type FS_BODY_QUAD are supported.
| quad1 | First body. |
| quad2 | Second body. |
Adds a body to a physics space.
Inserts a body so it will be updated during simulation. If the body limit is exceeded, the body is not added.
| space | Pointer to the physics space. |
| body | Pointer to the body to add. |
Creates a physics simulation space.
Initializes a physics space with gravity and damping parameters. The space starts empty, with no bodies attached.
| gravity | Gravity applied to all bodies. |
| damping | Velocity damping applied every simulation step. |
| void fsSpaceStep | ( | FsSpace * | space, |
| float | stepTime ) |
Advances the physics simulation.
Steps the physics simulation forward using a fixed timestep. Gravity, damping and velocity integration are applied.
| space | Pointer to the physics space. |
| stepTime | Simulation frequency (e.g. 60.0f for 60 Hz). |