Stowy Physics Engine 0.1.0
Loading...
Searching...
No Matches
stw::algo Namespace Reference

Namespace containing all the methods to get manifolds from collisions. This is here to separate the logic from the Collider class. Avoids the problem where we don't know if the circle-box collision resolution should be in the CircleCollider class or the box ColliderClass. More...

Functions

Manifold FindCircleCircleManifold (const CircleCollider *a, const Transform *ta, const CircleCollider *b, const Transform *tb)
 Finds the collision manifold between A and B.
 
Manifold FindCircleBoxManifold (const CircleCollider *a, const Transform *ta, const BoxCollider *b, const Transform *tb)
 Finds the collision manifold between A and B.
 
Manifold FindBoxCircleManifold (const BoxCollider *a, const Transform *ta, const CircleCollider *b, const Transform *tb)
 Finds the collision manifold between A and B.
 
Manifold FindBoxBoxManifold (const BoxCollider *a, const Transform *ta, const BoxCollider *b, const Transform *tb)
 Finds the collision manifold between A and B.
 
Manifold FindAabbAabbManifold (const AabbCollider *a, const Transform *ta, const AabbCollider *b, const Transform *tb)
 Finds the collision manifold between A and B.
 
Manifold FindAabbCircleManifold (const AabbCollider *a, const Transform *ta, const CircleCollider *b, const Transform *tb)
 Finds the collision manifold between A and B.
 
Manifold FindCircleAabbManifold (const CircleCollider *a, const Transform *ta, const AabbCollider *b, const Transform *tb)
 Finds the collision manifold between A and B.
 
Vector2 Support (const Collider *colliderA, const Transform *transformA, const Collider *colliderB, const Transform *transformB, const Vector2 &direction)
 Support function of the GJK algorithm.
 
Manifold Gjk (const Collider *colliderA, const Transform *transformA, const Collider *colliderB, const Transform *transformB)
 Finds the manifold between A and B using GJK.
 
bool NextSimplex (const Simplex &points, Vector2 &direction)
 Finds the next simplex for the GJK algorithm.
 
bool SameDirection (Vector2 direction, Vector2 ao)
 Finds if both vectors are going in the same direction.
 
bool Line (const Simplex &points, Vector2 &direction)
 Line case for the NextSimplex function.
 
bool Triangle (const Simplex &points, Vector2 &direction)
 Triangle case for the NextSimplex function.
 
Manifold Epa (const Simplex &simplex, const Collider *colliderA, const Transform *transformA, const Collider *colliderB, const Transform *transformB)
 Find the manifold from the last simplex of the GJK algorithm.
 
Manifold Sat (const BoxCollider *colliderA, const Transform *transformA, const BoxCollider *colliderB, const Transform *transformB)
 

Detailed Description

Namespace containing all the methods to get manifolds from collisions. This is here to separate the logic from the Collider class. Avoids the problem where we don't know if the circle-box collision resolution should be in the CircleCollider class or the box ColliderClass.

Function Documentation

◆ Epa()

Manifold stw::algo::Epa ( const Simplex & simplex,
const Collider * colliderA,
const Transform * transformA,
const Collider * colliderB,
const Transform * transformB )

Find the manifold from the last simplex of the GJK algorithm.

Parameters
simplexLast simplex of the GJK.
colliderACollider of object A.
transformATransform of object A.
colliderBCollider of object B.
transformBTransform of object B.
Returns
The manifold found.
Here is the call graph for this function:

◆ FindAabbAabbManifold()

Manifold stw::algo::FindAabbAabbManifold ( const AabbCollider * a,
const Transform * ta,
const AabbCollider * b,
const Transform * tb )

Finds the collision manifold between A and B.

Parameters
aAABB collider of the object A.
taTransform of the object A.
bAABB collider of the object B.
tbTransform of the object B.
Returns
The manifold of the collisions between A and B.
Here is the call graph for this function:

◆ FindAabbCircleManifold()

Manifold stw::algo::FindAabbCircleManifold ( const AabbCollider * a,
const Transform * ta,
const CircleCollider * b,
const Transform * tb )

Finds the collision manifold between A and B.

Parameters
aAABB collider of the object A.
taTransform of the object A.
bCircle collider of the object B.
tbTransform of the object B.
Returns
The manifold of the collisions between A and B.
Here is the call graph for this function:

◆ FindBoxBoxManifold()

Manifold stw::algo::FindBoxBoxManifold ( const BoxCollider * a,
const Transform * ta,
const BoxCollider * b,
const Transform * tb )

Finds the collision manifold between A and B.

Parameters
aBox collider of the object A.
taTransform of the object A.
bBox collider of the object B.
tbTransform of the object B.
Returns
The manifold of the collisions between A and B.
Here is the call graph for this function:

◆ FindBoxCircleManifold()

Manifold stw::algo::FindBoxCircleManifold ( const BoxCollider * a,
const Transform * ta,
const CircleCollider * b,
const Transform * tb )

Finds the collision manifold between A and B.

Parameters
aBox collider of the object A.
taTransform of the object A.
bCircle collider of the object B.
tbTransform of the object B.
Returns
The manifold of the collisions between A and B.
Here is the call graph for this function:

◆ FindCircleAabbManifold()

Manifold stw::algo::FindCircleAabbManifold ( const CircleCollider * a,
const Transform * ta,
const AabbCollider * b,
const Transform * tb )

Finds the collision manifold between A and B.

Parameters
aCircle collider of the object A.
taTransform of the object A.
bAABB collider of the object B.
tbTransform of the object B.
Returns
The manifold of the collisions between A and B.
Here is the call graph for this function:

◆ FindCircleBoxManifold()

Manifold stw::algo::FindCircleBoxManifold ( const CircleCollider * a,
const Transform * ta,
const BoxCollider * b,
const Transform * tb )

Finds the collision manifold between A and B.

Parameters
aCircle collider of the object A.
taTransform of the object A.
bBox collider of the object B.
tbTransform of the object B.
Returns
The manifold of the collisions between A and B.
Here is the call graph for this function:

◆ FindCircleCircleManifold()

Manifold stw::algo::FindCircleCircleManifold ( const CircleCollider * a,
const Transform * ta,
const CircleCollider * b,
const Transform * tb )

Finds the collision manifold between A and B.

Parameters
aCircle collider of the object A.
taTransform of the object A.
bCircle collider of the object B.
tbTransform of the object B.
Returns
The manifold of the collisions between A and B.
Here is the call graph for this function:

◆ Gjk()

Manifold stw::algo::Gjk ( const Collider * colliderA,
const Transform * transformA,
const Collider * colliderB,
const Transform * transformB )

Finds the manifold between A and B using GJK.

Parameters
colliderACollider of object A.
transformATransform of object A.
colliderBCollider of object B.
transformBTransform of object B.
Returns
Returns the manifold of the objects using the GJK algorithm.
Here is the call graph for this function:

◆ Line()

bool stw::algo::Line ( const Simplex & points,
Vector2 & direction )

Line case for the NextSimplex function.

Parameters
pointsPoints of the line simplex.
directionDirection of the next point.
Returns
True if we found the origin.
Here is the call graph for this function:

◆ NextSimplex()

bool stw::algo::NextSimplex ( const Simplex & points,
Vector2 & direction )

Finds the next simplex for the GJK algorithm.

Parameters
pointsCurrent simplex.
directionDirection in which to find the next simplex.
Returns
True if we found the origin.
Here is the call graph for this function:

◆ SameDirection()

bool stw::algo::SameDirection ( Vector2 direction,
Vector2 ao )

Finds if both vectors are going in the same direction.

Parameters
directionDirection vector.
aoVector between a and the origin.
Returns
True if both of the vectors are going in the same direction.
Here is the call graph for this function:

◆ Sat()

Manifold stw::algo::Sat ( const BoxCollider * colliderA,
const Transform * transformA,
const BoxCollider * colliderB,
const Transform * transformB )
Here is the call graph for this function:

◆ Support()

Vector2 stw::algo::Support ( const Collider * colliderA,
const Transform * transformA,
const Collider * colliderB,
const Transform * transformB,
const Vector2 & direction )

Support function of the GJK algorithm.

Parameters
colliderACollider of object A.
transformATransform of object A.
colliderBCollider of object B.
transformBTransform of object B.
directionDirection in which to find the vector.
Returns
The vertex found by the support function.
Here is the call graph for this function:

◆ Triangle()

bool stw::algo::Triangle ( const Simplex & points,
Vector2 & direction )

Triangle case for the NextSimplex function.

Parameters
pointsPoints of the Triangle simplex.
directionDirection of the next point.
Returns
True if we found the origin.
Here is the call graph for this function: