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

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

Detailed Description

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.

Constructor & Destructor Documentation

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

Parameters
simplex- [in] tetrahedron
Dubious::Physics::Minkowski_polytope::Minkowski_polytope ( const Minkowski_polytope )
delete

Member Function Documentation

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

Returns
the triangle and the distance to the triangle
Minkowski_polytope& Dubious::Physics::Minkowski_polytope::operator= ( const Minkowski_polytope )
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.

Parameters
v- [in] the new vector on the polytope

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