DubiousEngine  0.2.0
Simple Game Engine
Dubious::Physics::Contact_manifold Class Reference

Contains persistent contact information. More...

#include <Contact_manifold.h>

Classes

struct  Contact
 Contact information. More...
 

Public Member Functions

 Contact_manifold (const Physics_object &a, const Physics_object &b, float persistent_threshold)
 
void prune_old_contacts ()
 Prunes old contact points. More...
 
void insert (const std::vector< Contact > &contacts)
 Inserts contacts into the manifold;. More...
 
std::vector< Contact > & contacts ()
 contacts accessors More...
 
const std::vector< Contact > & contacts () const
 

Friends

class Physics_test::Contact_manifold_test
 

Detailed Description

Contains persistent contact information.

At each time slice a single contact between 2 intersecting objects can be found. Over a number of time slices a group of these contacts points are built up to create a contact manifold. This manifold class handles managing whether or not new contacts should be added, when old contacts should be removed, etc. Check out "Warm Starting" http://allenchou.net/2014/01/game-physics-stability-warm-starting/

Constructor & Destructor Documentation

Dubious::Physics::Contact_manifold::Contact_manifold ( const Physics_object a,
const Physics_object b,
float  persistent_threshold 
)

Member Function Documentation

std::vector<Contact>& Dubious::Physics::Contact_manifold::contacts ( )
inline

contacts accessors

const std::vector<Contact>& Dubious::Physics::Contact_manifold::contacts ( ) const
inline
void Dubious::Physics::Contact_manifold::insert ( const std::vector< Contact > &  contacts)

Inserts contacts into the manifold;.

Does the job of deciding if these contacts already exist and if so, maybe use the older ones? Or newer ones?

void Dubious::Physics::Contact_manifold::prune_old_contacts ( )

Prunes old contact points.

The manifold contains contact points from the previous time step. Some of these may have drifted out of contact, or they may have moved so far that we no longer want them in our manifold.

Friends And Related Function Documentation

friend class Physics_test::Contact_manifold_test
friend

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