physics
Classes | Enumerations | Functions | Variables
collision.hpp File Reference
#include "body.hpp"

Go to the source code of this file.

Classes

struct  Query
 A data structure to get data received from a collision. More...
 

Enumerations

enum  QueryType { EDGE_AB =0, FACE_AB =1, FACE_BA =2 }
 

Functions

unsigned int getSupport (CollisionBody &hull, vec3 n)
 Find furthest vertex along normal, n, and return its index into hull.a_bounding_vertices. More...
 
bool cylinderBoxCollision (const CollisionBody &cyl, const CollisionBody &obb)
 Check collision between a BodyType::CYLINDER CollisionBody and a BodyType::BOX CollisionBody. More...
 
bool sphereBoxCollision (const CollisionBody &hullA, vec3 closest_pt)
 Check collision between a CollisionBody and a sphere. More...
 
bool sphereSphereCollision (const CollisionBody &hullA, const CollisionBody &hullB)
 Check collision between a sphere and a sphere. More...
 
bool sphereCylinderCollision (const CollisionBody &body_a, vec3 closest_pt)
 Check collision between a sphere and a cylinder. More...
 
bool SAT (CollisionBody &hullA, CollisionBody &hullB, Query &query)
 Check collision between a CollisionBody and a CollisionBody. More...
 
vec3 closestPointOnCylinder (vec3 p, const CollisionBody &cylinder)
 Return the closest point on a cylinder, to another point, p. More...
 
Query queryFaceDirections (CollisionBody &hullA, CollisionBody &hullB)
 
Query queryEdgeDirections (CollisionBody &hullA, CollisionBody &hullB)
 Query for Edge collisions in SAT. More...
 
float rayOBBIntersect (vec3 origin, vec3 direction, mat3 obb_orientation)
 Ray OBB intersection function, returns a float along the vector origin + t * direction = contact_point. More...
 

Variables

float depth_epsilon
 

Enumeration Type Documentation

◆ QueryType

enum QueryType
Enumerator
EDGE_AB 
FACE_AB 
FACE_BA 

Function Documentation

◆ closestPointOnCylinder()

vec3 closestPointOnCylinder ( vec3  p,
const CollisionBody cylinder 
)

Return the closest point on a cylinder, to another point, p.

◆ cylinderBoxCollision()

bool cylinderBoxCollision ( const CollisionBody cyl,
const CollisionBody obb 
)

Check collision between a BodyType::CYLINDER CollisionBody and a BodyType::BOX CollisionBody.

◆ getSupport()

unsigned int getSupport ( CollisionBody hull,
vec3  n 
)

Find furthest vertex along normal, n, and return its index into hull.a_bounding_vertices.

◆ queryEdgeDirections()

Query queryEdgeDirections ( CollisionBody hullA,
CollisionBody hullB 
)

Query for Edge collisions in SAT.

◆ queryFaceDirections()

Query queryFaceDirections ( CollisionBody hullA,
CollisionBody hullB 
)
Todo:
Query for Face collisions in SAT.

◆ rayOBBIntersect()

float rayOBBIntersect ( vec3  origin,
vec3  direction,
mat3  obb_orientation 
)

Ray OBB intersection function, returns a float along the vector origin + t * direction = contact_point.

◆ SAT()

bool SAT ( CollisionBody hullA,
CollisionBody hullB,
Query query 
)

Check collision between a CollisionBody and a CollisionBody.

◆ sphereBoxCollision()

bool sphereBoxCollision ( const CollisionBody hullA,
vec3  closest_pt 
)

Check collision between a CollisionBody and a sphere.

◆ sphereCylinderCollision()

bool sphereCylinderCollision ( const CollisionBody body_a,
vec3  closest_pt 
)

Check collision between a sphere and a cylinder.

◆ sphereSphereCollision()

bool sphereSphereCollision ( const CollisionBody hullA,
const CollisionBody hullB 
)

Check collision between a sphere and a sphere.

Variable Documentation

◆ depth_epsilon

float depth_epsilon