Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | List of all members
om::physics::collision::GJKSolver Class Reference

A class that iteratively refines a 4-point simplex to determine if two convex shapes intersect. More...

#include <omPhysicsCollisionGJKSolver.h>

Public Member Functions

template<typename UserDataType1 , typename UserDataType2 , MinkowskiVertex(*)(const UserDataType1 *, const UserDataType2 *, const SIMDFloat4 &) getSupportPoint>
Bool solve (const UserDataType1 *userData1, const UserDataType2 *userData2, Size maxIterations, const SIMDFloat4 &searchStart, SIMDFloat4 &lastSearch, MinkowskiVertex *simplexResult)
 Determine whether or not two convex shapes intersect. More...
 

Detailed Description

A class that iteratively refines a 4-point simplex to determine if two convex shapes intersect.

Member Function Documentation

template<typename UserDataType1 , typename UserDataType2 , MinkowskiVertex(*)(const UserDataType1 *, const UserDataType2 *, const SIMDFloat4 &) getSupportPoint>
Bool om::physics::collision::GJKSolver::solve ( const UserDataType1 *  userData1,
const UserDataType2 *  userData2,
Size  maxIterations,
const SIMDFloat4 &  searchStart,
SIMDFloat4 &  lastSearch,
MinkowskiVertex simplexResult 
)

Determine whether or not two convex shapes intersect.

This method uses the specified template support point generation function to iteratively refine a 4-point simplex in minkowski-space until it contains the origin. When this happens, an intersection occurrs and TRUE is returned. If the algorithm does not converge and there is no way that the two shapes could intersect, FALSE is returned.

The function allows the user to specify a user data pointer which gets passed to the support point generation function. This is so that users of this class can easily access data necessary for support point generation.

The support point generation function should return a minkowski vertex object for the two points on the two convex shapes that are farthest in the given search direction.


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