DubiousEngine
0.2.0
Simple Game Engine
|
A Minkowski Polytope used in EPA. More...
#include <Minkowski_polytope.h>
Classes | |
struct | Triangle |
A surface triangle. More... | |
Public Member Functions | |
Minkowski_polytope (const Minkowski_simplex &simplex) | |
Usable Constructor. More... | |
Minkowski_polytope (const Minkowski_polytope &)=delete | |
Minkowski_polytope & | operator= (const Minkowski_polytope &)=delete |
std::tuple< Triangle, float > | find_closest_triangle () |
find the closest triangle to the origin More... | |
void | push_back (Minkowski_vector &&v) |
Add the vector to the polytope. More... | |
A Minkowski Polytope used in EPA.
Constructed from the output of the Minkowski Simplex created from the GJK collision detection. The Polytope keeps track of the expanding object used in EPA.
NOTE: This class is absolutely a hot spot when profiling. As such it uses a number of optimizations that I wouldn't usually suggest.
Dubious::Physics::Minkowski_polytope::Minkowski_polytope | ( | const Minkowski_simplex & | simplex | ) |
Usable Constructor.
constructs the polytope from the simplex. If the simplex is not a tetrahedron, this will throw an exception
simplex | - [in] tetrahedron |
|
delete |
std::tuple< Minkowski_polytope::Triangle, float > Dubious::Physics::Minkowski_polytope::find_closest_triangle | ( | ) |
find the closest triangle to the origin
Used in the EPA algorithm, we need to find the closest triangle to the origin. From there we will use that (if it's on the hull) or remove it and replace it with a new support point
|
delete |
void Dubious::Physics::Minkowski_polytope::push_back | ( | Minkowski_vector && | v | ) |
Add the vector to the polytope.
This is where the bulk of the work is done. Finds out which surfaces can "see" this vector and removes them. It then creates new triangles from the edges of the hole and this new vector.
v | - [in] the new vector on the polytope |