![]() |
Rune Engine
Version 0.2.7-alpha
Documentation for how to make games using the Rune Engine.
|
The physics module responsible for handling and resolving collisions between physics::Collider2D. More...
Classes | |
| struct | AABB |
| Axis aligned bounding box for each object. More... | |
| struct | body |
| Rigid body struct containing all the information for a physically realistic response. More... | |
| class | BoxCollider |
| class | CircleCollider |
| class | Collider |
| A collider that is to be used for registering collisions between objects in the scene. More... | |
| struct | collision |
| Collision manifold used for reporting rigid body collisions. More... | |
| class | RigidBody |
| Game object component that allows a game object to have collisions with other objects. More... | |
| class | World |
| A physics world that contains all the information needed to run physics. More... | |
Functions | |
| void | updatePhysics (std::vector< physics::RigidBody * > objects, double dT) |
| Function call made by the game scene to have objects get updated. More... | |
| std::vector< physics::collision > | broadPhaseCollisions (std::vector< physics::RigidBody * > boundingBoxes) |
| Broad phase collision responsible for determining collisions based off of AABB's only. | |
| std::vector< physics::collision > | narrowPhaseCollisions (std::vector< physics::collision > possibleCollisions) |
| Narrow phase collision responsible for determining if a possible collision is actually a collision after taking rotation into account. | |
| void | resolveCollisions (std::vector< physics::collision > currentCollision) |
| Resolve the definite collisions in a physically realistic way. More... | |
| 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... | |
The physics module responsible for handling and resolving collisions between physics::Collider2D.
| void physics::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::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::resolveCollisions | ( | std::vector< physics::collision > | collisions | ) |
Resolve the definite collisions in a physically realistic way.
| collisions | Collision manifolds for OBB's that were found to be definitely colliding. |
| void physics::updatePhysics | ( | std::vector< 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 |