Rune Engine  Version 0.2.7-alpha
Documentation for how to make games using the Rune Engine.
physics::World Class Reference

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::collisionbroadPhaseCollisions (rune::List< physics::RigidBody * > &boundingBoxes)
 
rune::List< physics::collisionnarrowPhaseCollisions (rune::List< physics::collision > &boundingBoxes)
 
void resolveCollisions (rune::List< physics::collision > &currentCollision)
 
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...
 

Detailed Description

A physics world that contains all the information needed to run physics.

Author
Thomas Montano
Date
July 21 2020

Member Function Documentation

◆ broadPhaseCollisions()

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.

Parameters
boundingBoxesThe physics::AABB list to be sorted through for possible collisions

◆ narrowPhaseCollisions()

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.

Parameters
boundingBoxesThe collision manifolds that have a possible collisions.

◆ positionalCorrection()

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.

Parameters
object1The first object in the collision.
object2The seconds object in the collision.
depthThe penetration depth in world coordinates.
normalThe normal vector for the collision.

◆ pythagoreanSolve()

double physics::World::pythagoreanSolve ( double  a,
double  b 
)

Solve for the hypotenuse given the two sides of a triangle.

Parameters
aFirst side of the triangle.
bSeconds side of the triangle.
Returns
The length of the hypotenuse.

◆ resolveCollisions()

void physics::World::resolveCollisions ( rune::List< physics::collision > &  currentCollision)

Resolve the definite collisions in a physically realistic way

Parameters
currentCollisionThe collision that is currently waiting to be resolved.

◆ updatePhysics()

void physics::World::updatePhysics ( rune::List< physics::RigidBody * > &  objects,
double  dT 
)

Function call made by the game scene to have objects get updated.

Parameters
objectsAn array of pointers to rigid bodies that should be considered for collision
dTThe amount of time that the physics frame occupies

The documentation for this class was generated from the following files: