VisimBox 1.0 VisimBox 3d simulation and visualisation ToolBox

- Main Page
- Packages
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
VisiMath.Collisions.GJK_EPASolver Class Reference

GJK-EPA convex hulls collision solver. More...

List of all members.

## Classes
class | Face
class | HashTabItem
struct | MinkowskiVertice
## Public Member Functions
bool | Collide (IConvexObject shape1, IConvexObject shape2)
| Performs quick collision check using GJK algorithm, both objects are already transformed to world space.
bool | Collide (IConvexObject shape1, ref Matrix4 mat1, IConvexObject shape2, ref Matrix4 mat2)
| Performs quick collision check using GJK algorithm.
bool | Collide (IConvexObject shape1, ref Matrix4 mat1, IConvexObject shape2, ref Matrix4 mat2, ref CollisionInfo info)
| Performs full collision test for two objects using GJK and EPA algorithm.
float | ClosestDistance (IConvexObject shape1, ref Matrix4 mat1, IConvexObject shape2, ref Matrix4 mat2)
| Returns closest distance between two objects.
bool | SolveSimplex2 (ref Vector3 aOrigin, ref Vector3 aB)
| Solve simplex 2.
bool | SolveSimplex3 (ref Vector3 aOrigin, ref Vector3 aB, ref Vector3 aC)
bool | SolveSimplex3 (ref Vector3 aOrigin, ref Vector3 aB, ref Vector3 aC, ref Vector3 crossabc)
bool | SolveSimplex4 (ref Vector3 ao, ref Vector3 ab, ref Vector3 ac, ref Vector3 ad)
## Public Attributes
bool | EPAFailed = false
float | GJKMargin = 0.05f
| GJK phase error margin.
int | GJKIterations
| GJK iterations used.
int | EPAIterations
| EPA iterations used.
float | EPAAccuracy = 0.001f
## Protected Member Functions
int | Hash (ref Vector3 v)
| returns vector hash for hashtable
bool | FetchSupport ()
## Protected Attributes
IConvexObject[] | Shapes = new IConvexObject[2]
Matrix4 | MatrixTo0
Matrix3 | MatrixTo1
Vector3[] | Positions = new Vector3[2]
int | GJKOrder = -1
Vector3 | _Ray
Matrix4 | Identity = Matrix4.Identitity

## Detailed Description

GJK-EPA convex hulls collision solver.

Based on GJK EPA solver by Nathanael Person

## Member Function Documentation

float VisiMath.Collisions.GJK_EPASolver.ClosestDistance | ( | IConvexObject | shape1,
|  | ref Matrix4 | mat1,
|  | IConvexObject | shape2,
|  | ref Matrix4 | mat2
| ) |  |

Returns closest distance between two objects.

Parameters:

  shape1 | Physical shape 1 (should be more complicated one)
  mat1 | world transformation for shape 1
  shape2 | Physical shape 2
  mat2 | world transformation for shape 2

Returns:
  Distance between objects or zero if penetrating

bool VisiMath.Collisions.GJK_EPASolver.Collide | ( | IConvexObject | shape1,
|  | IConvexObject | shape2
| ) |  |

Performs quick collision check using GJK algorithm, both objects are already transformed to world space.

Parameters:

  shape1 | Physical shape 1 (should be more complicated one)
  shape2 | Physical shape 2

Returns:
  True if objects (with their envelopes) collide

bool VisiMath.Collisions.GJK_EPASolver.Collide | ( | IConvexObject | shape1,
|  | ref Matrix4 | mat1,
|  | IConvexObject | shape2,
|  | ref Matrix4 | mat2
| ) |  |

Performs quick collision check using GJK algorithm.

Parameters:

  shape1 | Physical shape 1 (should be more complicated one)
  mat1 | world transformation for shape 1
  shape2 | Physical shape 2
  mat2 | world transformation for shape 2

Returns:
  True if objects (with their envelopes) collide

bool VisiMath.Collisions.GJK_EPASolver.Collide | ( | IConvexObject | shape1,
|  | ref Matrix4 | mat1,
|  | IConvexObject | shape2,
|  | ref Matrix4 | mat2,
|  | ref CollisionInfo | info
| ) |  |

Performs full collision test for two objects using GJK and EPA algorithm.

Parameters:

  shape1 | Physical shape 1 (should be more complicated one)
  mat1 | world transformation for shape 1
  shape2 | Physical shape 2
  mat2 | world transformation for shape 2

Returns:
  True if objects (with their envelopes) collide

bool VisiMath.Collisions.GJK_EPASolver.FetchSupport | ( |  | ) | `[protected]`

int VisiMath.Collisions.GJK_EPASolver.Hash | ( | ref Vector3 | v | ) | `[protected]`

returns vector hash for hashtable

Parameters:

  v |

Returns:

bool VisiMath.Collisions.GJK_EPASolver.SolveSimplex2 | ( | ref Vector3 | aOrigin,
|  | ref Vector3 | aB
| ) |  |

Solve simplex 2.

Parameters:

  aOrigin | A to origin
  aB | A to B

Returns:
  true if intersection

bool VisiMath.Collisions.GJK_EPASolver.SolveSimplex3 | ( | ref Vector3 | aOrigin,
|  | ref Vector3 | aB,
|  | ref Vector3 | aC
| ) |  |

bool VisiMath.Collisions.GJK_EPASolver.SolveSimplex3 | ( | ref Vector3 | aOrigin,
|  | ref Vector3 | aB,
|  | ref Vector3 | aC,
|  | ref Vector3 | crossabc
| ) |  |

bool VisiMath.Collisions.GJK_EPASolver.SolveSimplex4 | ( | ref Vector3 | ao,
|  | ref Vector3 | ab,
|  | ref Vector3 | ac,
|  | ref Vector3 | ad
| ) |  |

## Member Data Documentation

Vector3 VisiMath.Collisions.GJK_EPASolver._Ray`[protected]`

float VisiMath.Collisions.GJK_EPASolver.EPAAccuracy = 0.001f

bool VisiMath.Collisions.GJK_EPASolver.EPAFailed = false

int VisiMath.Collisions.GJK_EPASolver.EPAIterations

EPA iterations used.

int VisiMath.Collisions.GJK_EPASolver.GJKIterations

GJK iterations used.

float VisiMath.Collisions.GJK_EPASolver.GJKMargin = 0.05f

GJK phase error margin.

int VisiMath.Collisions.GJK_EPASolver.GJKOrder = -1`[protected]`

Matrix4 VisiMath.Collisions.GJK_EPASolver.Identity = Matrix4.Identitity`[protected]`

Matrix4 VisiMath.Collisions.GJK_EPASolver.MatrixTo0`[protected]`

Matrix3 VisiMath.Collisions.GJK_EPASolver.MatrixTo1`[protected]`

Vector3 [] VisiMath.Collisions.GJK_EPASolver.Positions = new Vector3[2]`[protected]`

IConvexObject [] VisiMath.Collisions.GJK_EPASolver.Shapes = new IConvexObject[2]`[protected]`

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

- GJK-EPASolver.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events