Libraries.Game.Collision.Narrowphase.ConvexConvexSubSimplexClosestResult Documentation

This class stores the result from the calculation in the class ConvexConvexSimplexSolver. Therefore, this class contains what is a closest point from a point of interest to a point, or a line, or a triangle, or a tetrahedron (and we classify all these shapes under the term Simplex).

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)

Degenerate()

This action lets you know if a simplex is degenerate or not. For example, a degeneration triangle would have vertices A, B, C with two of these vertices being the same point.

Return

boolean:

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)

GetBarycentricCoordinates()

This action gets the numbers that will describe where the point of interest is with respect to the simplex.

Return

Libraries.Containers.Array:

GetClosestPointOnSimplex()

This action returns where the closest point on a simplex is to the point of interest.

Return

Libraries.Compute.Vector3:

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()

IsValid()

This action checks if the closest point calculation is valid or not.

Return

boolean:

Reset()

This action resets all of the variables inside this class.

SetBarycentricCoordinates(number a, number b, number c, number d)

This action sets the numbers that will describe where the point of interest is with respect to the simplex.

Parameters

  • number a
  • number b
  • number c
  • number d

SetClosestPointOnSimplex(Libraries.Compute.Vector3 point)

This action sets where the closest point on a simplex is to the point of interest.

Parameters

SetDegenerate(boolean flag)

This action sets if a simplex is degenerate or not. For example, a degeneration triangle would have vertices A, B, C with two of these vertices being the same point.

Parameters

  • boolean flag

SetUsedVertexA(boolean flag)

This action sets whether the point of interest is close to vertex A or not.

Parameters

  • boolean flag

SetUsedVertexB(boolean flag)

This action sets whether the point of interest is close to vertex B or not.

Parameters

  • boolean flag

SetUsedVertexC(boolean flag)

This action sets whether the point of interest is close to vertex C or not.

Parameters

  • boolean flag

SetUsedVertexD(boolean flag)

This action sets whether the point of interest is close to vertex D or not.

Parameters

  • boolean flag

UsedVertexA()

This action lets you know whether the point of interest is close to vertex A or not.

Return

boolean:

UsedVertexB()

This action lets you know whether the point of interest is close to vertex B or not.

Return

boolean:

UsedVertexC()

This action lets you know whether the point of interest is close to vertex C or not.

Return

boolean:

UsedVertexD()

This action lets you know whether the point of interest is close to vertex D or not.

Return

boolean:

UsedVerticesReset()

This action resets all vertices so that none of them are used.