physics
Classes | Enumerations | Functions
contact.hpp File Reference
#include "body.hpp"
#include "spherical_joint.hpp"
#include "hinge_joint.hpp"
#include "mouse_joint.hpp"
#include "collision.hpp"

Go to the source code of this file.

Classes

class  Contact
 A data structure to pass data received from a collision to the solver. More...
 

Enumerations

enum  ContactType { FACE =0, EDGE =1 }
 

Functions

vector< ContactgetContacts (CollisionBody &body)
 Get contacts for a CollisionBody. More...
 
vector< FacegetMostParallelFace (const CollisionBody &hull, vec3 normal)
 Find the Face on the CollisionBody that is most parallel to the vector, normal. More...
 
vector< FacegetMostAntiparallelFace (const CollisionBody &hull, vec3 normal)
 Find the Face on the CollisionBody that is most anti-parallel to the vector, normal. More...
 
vector< FacegetOrthogonalFaces (const CollisionBody &hull, vec3 normal)
 Find the Face's that are orthogonal to the vector, normal, used for clipping to generate contact points. More...
 
vector< ContactsphereSphereContacts (CollisionBody &body_a, CollisionBody &body_b)
 A data structure to contain the data received from a collision between a sphere and a sphere. More...
 
vector< ContactsphereTriContacts (CollisionBody &body_a, CollisionBody &body_b)
 A data structure to contain the data received from a collision between a sphere and a tri. More...
 
vector< ContactsphereBoxContacts (CollisionBody &body_a, CollisionBody &body_b)
 A data structure to contain the data received from a collision between a sphere and a box. More...
 
vector< ContacthullHullContacts (CollisionBody &body_a, CollisionBody &body_b)
 A data structure to contain the data received from a collision between a box and a box. More...
 
vector< ContactboxCylinderContacts (CollisionBody &body_a, CollisionBody &body_b)
 A data structure to contain the data received from a collision between a box and a box. More...
 
vector< ContactsphereCylinderContacts (CollisionBody &body_a, CollisionBody &body_b)
 A data structure to contain the data received from a collision between a Sphere and a Cylinder. More...
 
vector< ContactcylinderCylinderContacts (CollisionBody &body_a, CollisionBody &body_b)
 A data structure to contain the data received from a collision between a Cylinder and a Cylinder. More...
 
vector< ContactcreateContacts (CollisionBody &body_a, CollisionBody &body_b)
 Generate contacts between two CollisionBody's. More...
 
vector< ContactcreateMinimalContacts (vector< Contact > &contacts)
 Reduce a vector of Contact's to 4 that are the most stable. More...
 
vec3 closestPointOnTri (vec3 sphereCentre, vec3 p0, vec3 p1, vec3 p2)
 Return the point on a tri that is closest to a point. More...
 
vector< vec3 > collisionPoints (CollisionBody &body_a, CollisionBody &body_b)
 Return collision points on each CollisionBody. More...
 
int simulate (float deltaTime)
 Access function for the physics time step function, called on the client-side manually in the update function. More...
 
vector< ContactGJKEPAContacts (CollisionBody &body_a, CollisionBody &body_b)
 

Enumeration Type Documentation

◆ ContactType

Enumerator
FACE 
EDGE 

Function Documentation

◆ boxCylinderContacts()

vector<Contact> boxCylinderContacts ( CollisionBody body_a,
CollisionBody body_b 
)

A data structure to contain the data received from a collision between a box and a box.

◆ closestPointOnTri()

vec3 closestPointOnTri ( vec3  sphereCentre,
vec3  p0,
vec3  p1,
vec3  p2 
)

Return the point on a tri that is closest to a point.

◆ collisionPoints()

vector<vec3> collisionPoints ( CollisionBody body_a,
CollisionBody body_b 
)

Return collision points on each CollisionBody.

◆ createContacts()

vector<Contact> createContacts ( CollisionBody body_a,
CollisionBody body_b 
)

Generate contacts between two CollisionBody's.

◆ createMinimalContacts()

vector<Contact> createMinimalContacts ( vector< Contact > &  contacts)

Reduce a vector of Contact's to 4 that are the most stable.

◆ cylinderCylinderContacts()

vector<Contact> cylinderCylinderContacts ( CollisionBody body_a,
CollisionBody body_b 
)

A data structure to contain the data received from a collision between a Cylinder and a Cylinder.

◆ getContacts()

vector<Contact> getContacts ( CollisionBody body)

Get contacts for a CollisionBody.

◆ getMostAntiparallelFace()

vector<Face> getMostAntiparallelFace ( const CollisionBody hull,
vec3  normal 
)

Find the Face on the CollisionBody that is most anti-parallel to the vector, normal.

◆ getMostParallelFace()

vector<Face> getMostParallelFace ( const CollisionBody hull,
vec3  normal 
)

Find the Face on the CollisionBody that is most parallel to the vector, normal.

◆ getOrthogonalFaces()

vector<Face> getOrthogonalFaces ( const CollisionBody hull,
vec3  normal 
)

Find the Face's that are orthogonal to the vector, normal, used for clipping to generate contact points.

◆ GJKEPAContacts()

vector<Contact> GJKEPAContacts ( CollisionBody body_a,
CollisionBody body_b 
)

◆ hullHullContacts()

vector<Contact> hullHullContacts ( CollisionBody body_a,
CollisionBody body_b 
)

A data structure to contain the data received from a collision between a box and a box.

◆ simulate()

int simulate ( float  deltaTime)

Access function for the physics time step function, called on the client-side manually in the update function.

◆ sphereBoxContacts()

vector<Contact> sphereBoxContacts ( CollisionBody body_a,
CollisionBody body_b 
)

A data structure to contain the data received from a collision between a sphere and a box.

◆ sphereCylinderContacts()

vector<Contact> sphereCylinderContacts ( CollisionBody body_a,
CollisionBody body_b 
)

A data structure to contain the data received from a collision between a Sphere and a Cylinder.

◆ sphereSphereContacts()

vector<Contact> sphereSphereContacts ( CollisionBody body_a,
CollisionBody body_b 
)

A data structure to contain the data received from a collision between a sphere and a sphere.

◆ sphereTriContacts()

vector< Contact > sphereTriContacts ( CollisionBody body_a,
CollisionBody body_b 
)

A data structure to contain the data received from a collision between a sphere and a tri.