SimplexCache2D

Package: Libraries.Game.Collision.Narrowphase · Inherits from: Libraries.Language.Object

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.

Actions

GetCount()

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

Returns

integer

GetIndexA()

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

Returns

Libraries.Containers.Array<integer>

GetIndexB()

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

Returns

Libraries.Containers.Array<integer>

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.

Returns

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

  • count integer

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

  • metric number

Inherited Actions

3 actions from Libraries.Language.Object