DubiousEngine
0.2.0
Simple Game Engine
|
Collision solver that implements GJK. More...
#include <Collision_solver.h>
Public Member Functions | |
Collision_solver ()=default | |
Default constructor. More... | |
Collision_solver (const Collision_solver &)=delete | |
Collision_solver & | operator= (const Collision_solver &)=delete |
bool | intersection (const Physics_object &a, const Physics_object &b, std::vector< Contact_manifold::Contact > &contacts) const |
find the intersection of 2 objects More... | |
bool | broad_phase_intersection (const Physics_object &a, const Physics_object &b) const |
cheap and cheerful intersection test More... | |
Collision solver that implements GJK.
Given two PhysicsObjects, figure out if they intersect. Uses the GJK algorithm to find object intersection: http://mollyrocket.com/849 http://hacktank.net/blog/?p=93 As well as the EPA algorithm to find the contact point and normal: http://hacktank.net/blog/?p=119 http://allenchou.net/2013/12/game-physics-contact-generation-epa/ http://stackoverflow.com/questions/31764305/im-implementing-the-expanding-polytope-algorithm-and-i-am-unsure-how-to-deduce
|
default |
Default constructor.
|
delete |
bool Dubious::Physics::Collision_solver::broad_phase_intersection | ( | const Physics_object & | a, |
const Physics_object & | b | ||
) | const |
cheap and cheerful intersection test
This is a cheap and very rough intersection test. It only looks to see if the radius of the 2 objects added is more than the distance between them. If it is then the objects might be touching
a | - [in] the first object |
b | - [in] the second object |
bool Dubious::Physics::Collision_solver::intersection | ( | const Physics_object & | a, |
const Physics_object & | b, | ||
std::vector< Contact_manifold::Contact > & | contacts | ||
) | const |
find the intersection of 2 objects
This is the main entry point to the collision solver. Given two objects, find out if they collide, and if so, where. This is a work in progress.
a | - [in] the first object |
b | - [in] the second object |
contacts | - [out] contact information |
|
delete |