Libraries.Game.Collision.Narrowphase.SimplexVertex2D Documentation

This class records the support points between shapes A and B. This class is used internally by Simplex2D.

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)

GetBarycentricCoordinate()

This action gets the barycentric coordinate that is multiplied to the support points stored in the current SimplexVertex2D class.

Return

number:

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 index of supportA on shape A.

Return

integer:

GetIndexB()

This action returns the index of supportB on shape B.

Return

integer:

GetSupport()

This action gets the support point on the Minkowski difference of the two shapes.

Return

Libraries.Compute.Vector2:

GetSupportA()

This action returns a support point on shape A in global coordinates.

Return

Libraries.Compute.Vector2:

GetSupportB()

This action gets a support point on shape B in global coordinates.

Return

Libraries.Compute.Vector2:

Set(Libraries.Game.Collision.Narrowphase.SimplexVertex2D vertex)

This action sets this SimplexVertex2D class with another SimplexVertex2D.

Parameters

SetBarycentricCoordinate(number coordinate)

This action sets the barycentric coordinate that is multiplied to the support points stored in the current SimplexVertex2D class.

Parameters

  • number coordinate

SetIndexA(integer index)

This action sets the index of supportA on shape A.

Parameters

  • integer index

SetIndexB(integer index)

This action sets the index of supportB on shape B.

Parameters

  • integer index

SetSupport(Libraries.Compute.Vector2 support)

This action sets the support point on the Minkowski difference of the two shapes.

Parameters

SetSupportA(Libraries.Compute.Vector2 support)

This action sets a support point on shape A in global coordinates.

Parameters

SetSupportB(Libraries.Compute.Vector2 support)

This action sets a support point on shape B in global coordinates.

Parameters