## Libraries.Game.Collision.Narrowphase.ConvexConvexSimplexSolver Documentation

This action finds the closest point on a object to the origin.

*Inherits from: *Libraries.Language.Object

## Summary

### Actions Summary Table

Actions | Description |
---|---|

AddVertex(Libraries.Compute.Vector3 w, Libraries.Compute.Vector3 p, Libraries.Compute.Vector3 q) | This action updates the simplex. |

BackupClosest(Libraries.Compute.Vector3 v) | This action saves the closest vertex to the origin inside the "Vector3 v. |

Closest(Libraries.Compute.Vector3 v) | This action temporarily stores a vertex on the current simplex that is closest to the origin. |

Compare(Libraries.Language.Object object) | This action compares two object hash codes and returns an integer. |

ComputePoints(Libraries.Compute.Vector3 p1, Libraries.Compute.Vector3 p2) | This action calls the action UpdateClosestVectorAndPoints and stores two different points temporarily to be used later. |

EmptySimplex() | This action returns whether you have a simplex currently or not. |

Equals(Libraries.Language.Object object) | This action determines if two objects are equal based on their hash code values. |

FullSimplex() | This action returns whether you have a tetrahedron as your current simplex. |

GetCachedPointA() | This action returns whether you have a simplex currently or not. |

GetCachedPointB() | This action tests whether a vertex is inside the current simplex. |

GetCachedVector() | This action returns the maximum distance from the origin to a vertex in the simplex. |

GetHashCode() | This action gets the hash code for an object. |

GetLastW() | This action updates the simplex. |

GetNumberOfVertices() | This action returns the number of vertices there is in a simplex. |

GetSimplexPointsP() | This action returns the number of vertices there is in a simplex. |

GetSimplexPointsQ() | This action calls the action UpdateClosestVectorAndPoints and stores two different points temporarily to be used later. |

GetSimplexVectorW() | This action sets the number of vertices there is in a simplex. |

InSimplex(Libraries.Compute.Vector3 w) | This action tests whether a vertex is inside the current simplex. |

IsCachedValidClosest() | if they are on opposite sides of the pla |

MaxVertex() | This action returns the maximum distance from the origin to a vertex in the simplex. |

NeedsUpdate() | This action updates the vertex on the current simplex that is closest to the origin and also updates the closest point from the current simplex to the origin. |

ReduceVertices(Libraries.Game.Collision.Narrowphase.ConvexConvexSubSimplexClosestResult usedVerts) | This action ignores the vertices that are unused inside a ConvexConvesSubSimplexClosestResult class, which can hold up to 4 vertices. |

RemoveVertex(integer index) | This action removes a vertex from a simplex (which is the umbrella term for a point, a line, a triangle, or a tetrahedron). |

Reset() | This action resets the ConvexConvexSimplexSolver. |

SetCachedPointA(Libraries.Compute.Vector3 point) | This action saves the closest vertex to the origin inside the "Vector3 v. |

SetCachedPointB(Libraries.Compute.Vector3 point) | This action returns whether you have a tetrahedron as your current simplex. |

SetCachedValidClosest(boolean flag) | if they are both on the pla |

SetCachedVector(Libraries.Compute.Vector3 vector) | This action temporarily stores a vertex on the current simplex that is closest to the origin. |

SetLastW(Libraries.Compute.Vector3 vector) | This action resets the ConvexConvexSimplexSolver. |

SetNeedsUpdate(boolean flag) | This action ignores the vertices that are unused inside a ConvexConvesSubSimplexClosestResult class, which can hold up to 4 vertices. |

SetNumberOfVertices(integer numberOfVertices) | This action sets the number of vertices there is in a simplex. |

UpdateClosestVectorAndPoints() | This action updates the vertex on the current simplex that is closest to the origin and also updates the closest point from the current simplex to the origin. |

## Actions Documentation

### AddVertex(Libraries.Compute.Vector3 w, Libraries.Compute.Vector3 p, Libraries.Compute.Vector3 q)

This action updates the simplex.

#### Parameters

### BackupClosest(Libraries.Compute.Vector3 v)

This action saves the closest vertex to the origin inside the "Vector3 v."

#### Parameters

### Closest(Libraries.Compute.Vector3 v)

This action temporarily stores a vertex on the current simplex that is closest to the origin.

#### Parameters

#### Return

boolean:

### Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

**Example Code**

```
Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)
```

#### Parameters

- Libraries.Language.Object: The object to compare to.

#### Return

integer: The Compare result, Smaller, Equal, or Larger.

### ComputePoints(Libraries.Compute.Vector3 p1, Libraries.Compute.Vector3 p2)

This action calls the action UpdateClosestVectorAndPoints and stores two different points temporarily to be used later. These two points can be anything that you know you will need later.

#### Parameters

### EmptySimplex()

This action returns whether you have a simplex currently or not.

#### Return

boolean:

### Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

**Example Code**

```
use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)
```

#### Parameters

- Libraries.Language.Object: The to be compared.

#### Return

boolean: True if the hash codes are equal and false if they are not equal.

### FullSimplex()

This action returns whether you have a tetrahedron as your current simplex.

#### Return

boolean:

### GetCachedPointA()

This action returns whether you have a simplex currently or not.

#### Return

### GetCachedPointB()

This action tests whether a vertex is inside the current simplex.

#### Return

### GetCachedVector()

This action returns the maximum distance from the origin to a vertex in the simplex.

#### Return

### GetHashCode()

This action gets the hash code for an object.

**Example Code**

```
Object o
integer hash = o:GetHashCode()
```

#### Return

integer: The integer hash code of the object.

### GetLastW()

This action updates the simplex.

#### Return

### GetNumberOfVertices()

This action returns the number of vertices there is in a simplex.

#### Return

number:

### GetSimplexPointsP()

This action returns the number of vertices there is in a simplex.

#### Return

### GetSimplexPointsQ()

This action calls the action UpdateClosestVectorAndPoints and stores two different points temporarily to be used later. These two points can be anything that you know you will need later.

#### Return

### GetSimplexVectorW()

This action sets the number of vertices there is in a simplex.

#### Return

### InSimplex(Libraries.Compute.Vector3 w)

This action tests whether a vertex is inside the current simplex.

#### Parameters

#### Return

boolean:

### IsCachedValidClosest()

if they are on opposite sides of the pla

#### Return

boolean:

### MaxVertex()

This action returns the maximum distance from the origin to a vertex in the simplex.

#### Return

number:

### NeedsUpdate()

This action updates the vertex on the current simplex that is closest to the origin and also updates the closest point from the current simplex to the origin.

#### Return

boolean:

### ReduceVertices(Libraries.Game.Collision.Narrowphase.ConvexConvexSubSimplexClosestResult usedVerts)

This action ignores the vertices that are unused inside a ConvexConvesSubSimplexClosestResult class, which can hold up to 4 vertices.

#### Parameters

### RemoveVertex(integer index)

This action removes a vertex from a simplex (which is the umbrella term for a point, a line, a triangle, or a tetrahedron).

#### Parameters

### Reset()

This action resets the ConvexConvexSimplexSolver.

### SetCachedPointA(Libraries.Compute.Vector3 point)

This action saves the closest vertex to the origin inside the "Vector3 v."

#### Parameters

### SetCachedPointB(Libraries.Compute.Vector3 point)

This action returns whether you have a tetrahedron as your current simplex.

#### Parameters

### SetCachedValidClosest(boolean flag)

if they are both on the pla

#### Parameters

### SetCachedVector(Libraries.Compute.Vector3 vector)

This action temporarily stores a vertex on the current simplex that is closest to the origin.

#### Parameters

### SetLastW(Libraries.Compute.Vector3 vector)

This action resets the ConvexConvexSimplexSolver.

#### Parameters

### SetNeedsUpdate(boolean flag)

#### Parameters

### SetNumberOfVertices(integer numberOfVertices)

This action sets the number of vertices there is in a simplex.

#### Parameters

### UpdateClosestVectorAndPoints()

#### Return

boolean: