![]() |
Rune Engine
Version 0.2.7-alpha
Documentation for how to make games using the Rune Engine.
|
A physics world that contains all the information needed to run physics. More...
#include <world.h>
Public Member Functions | |
World () | |
Default empty constructor for a new physics world. | |
void | step (void) |
Integrates the world over the next timestep. | |
void | updatePhysics (rune::List< physics::RigidBody * > &objects, double dT) |
Function call made by the game scene to have objects get updated. More... | |
rune::List< physics::collision > | broadPhaseCollisions (rune::List< physics::RigidBody * > &boundingBoxes) |
rune::List< physics::collision > | narrowPhaseCollisions (rune::List< physics::collision > &boundingBoxes) |
void | resolveCollisions (rune::List< physics::collision > ¤tCollision) |
void | positionalCorrection (physics::RigidBody *object1, physics::RigidBody *object2, double penetration, rune::Vec2 normal) |
Correct the position of the object each frame so that it doesn't look like two objects are overlapping. More... | |
double | pythagoreanSolve (double a, double b) |
Solve for the hypotenuse given the two sides of a triangle. More... | |
A physics world that contains all the information needed to run physics.
rune::List< physics::collision > physics::World::broadPhaseCollisions | ( | rune::List< physics::RigidBody * > & | boundingBoxes | ) |
Broad phase collision responsible for determining collisions based off of AABB's only.
boundingBoxes | The physics::AABB list to be sorted through for possible collisions |
rune::List< physics::collision > physics::World::narrowPhaseCollisions | ( | rune::List< physics::collision > & | boundingBoxes | ) |
Narrow phase collision responsible for determining if a possible collision is actually a collision after taking rotation into account.
boundingBoxes | The collision manifolds that have a possible collisions. |
void physics::World::positionalCorrection | ( | physics::RigidBody * | object1, |
physics::RigidBody * | object2, | ||
double | depth, | ||
rune::Vec2 | normal | ||
) |
Correct the position of the object each frame so that it doesn't look like two objects are overlapping.
object1 | The first object in the collision. |
object2 | The seconds object in the collision. |
depth | The penetration depth in world coordinates. |
normal | The normal vector for the collision. |
double physics::World::pythagoreanSolve | ( | double | a, |
double | b | ||
) |
Solve for the hypotenuse given the two sides of a triangle.
a | First side of the triangle. |
b | Seconds side of the triangle. |
void physics::World::resolveCollisions | ( | rune::List< physics::collision > & | currentCollision | ) |
Resolve the definite collisions in a physically realistic way
currentCollision | The collision that is currently waiting to be resolved. |
void physics::World::updatePhysics | ( | rune::List< physics::RigidBody * > & | objects, |
double | dT | ||
) |
Function call made by the game scene to have objects get updated.
objects | An array of pointers to rigid bodies that should be considered for collision |
dT | The amount of time that the physics frame occupies |