## Libraries.Game.Collision.Narrowphase.SimplexCache2D Documentation

This class records the vertices from shapes A and B that are invovled in the current simplex of the Minkowski difference of the shapes so that Distance2D class can just refer to this SimplexCache to find the vertices instead of having to extract these information from Simplex2D class.

*Inherits from: *Libraries.Language.Object

## Summary

### Actions Summary Table

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

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

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

GetCount() | This action returns what kind of simplex is currently being used. |

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

GetIndexA() | This action returns the indices of the vertices of object A that is inside the current simplex. |

GetIndexB() | This action returns the indices of the vertices of object B that is inside the current simplex. |

GetMetric() | This action gets the denominator to normalize the barycentric coordinates with. |

Set(Libraries.Game.Collision.Narrowphase.SimplexCache2D simplexCache) | This action sets the current SimplexCache2D class with another SimplexCache2D object. |

SetCount(integer count) | This action sets what kind of simplex is currently being used. |

SetMetric(number metric) | This action sets the denominator to normalize the barycentric coordinates with. |

## Actions Documentation

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

This action compares two object hash codes and returns a CompareResult. The compare result is either larger if this hash code is larger than the object passed as a parameter, smaller, or equal.

**Example Code**

```
use Libraries.Language.Support.CompareResult
Object o
Object t
CompareResult result = o:Compare(t)
```

#### Parameters

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

#### Return

Libraries.Language.Support.CompareResult: The Compare result, Smaller, Equal, or Larger.

### 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.

### GetCount()

This action returns what kind of simplex is currently being used. 1: a point simplex. 2: a line simplex. 3: a triangle simplex.

#### Return

integer:

### 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.

### GetIndexA()

This action returns the indices of the vertices of object A that is inside the current simplex.

#### Return

### GetIndexB()

This action returns the indices of the vertices of object B that is inside the current simplex.

#### Return

### GetMetric()

This action gets the denominator to normalize the barycentric coordinates with. For a point, don't need to normalize. For a line, the barycentric coordinates are normalized by the length of the line. For a triangle, the barycentric coordinates are normalized by the area of the triangle.

#### Return

number:

### Set(Libraries.Game.Collision.Narrowphase.SimplexCache2D simplexCache)

This action sets the current SimplexCache2D class with another SimplexCache2D object.

#### Parameters

### SetCount(integer count)

This action sets what kind of simplex is currently being used. 1: a point simplex. 2: a line simplex. 3: a triangle simplex.

#### Parameters

### SetMetric(number metric)

This action sets the denominator to normalize the barycentric coordinates with. For a point, don't need to normalize. For a line, the barycentric coordinates are normalized by the length of the line. For a triangle, the barycentric coordinates are normalized by the area of the triangle.