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

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_solveroperator= (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...
 

Detailed Description

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

Constructor & Destructor Documentation

Dubious::Physics::Collision_solver::Collision_solver ( )
default

Default constructor.

Dubious::Physics::Collision_solver::Collision_solver ( const Collision_solver )
delete

Member Function Documentation

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

Parameters
a- [in] the first object
b- [in] the second object
Returns
true if they might collide
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.

Parameters
a- [in] the first object
b- [in] the second object
contacts- [out] contact information
Returns
true if they collide
Collision_solver& Dubious::Physics::Collision_solver::operator= ( const Collision_solver )
delete

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