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

Actions Documentation

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.

Parameters

Return

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

Example

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

Equals(Libraries.Language.Object object)

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

Parameters

Return

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

Example

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

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.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

GetIndexA()

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

Return

Libraries.Containers.Array:

GetIndexB()

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

Return

Libraries.Containers.Array:

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

  • integer count

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.

Parameters

  • number metric