Libraries.Game.Collision.Narrowphase.ConvexConvexDistanceSolver Documentation

This class solves for the distance between the two colliding objects.

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)

EncloseOrigin()

This action returns whether the simplex that you built contains the origin or not.

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)

Failed()

This action returns whether the distance solver has failed or not.

Return

boolean:

FetchSupport()

This action finds a support point in an arbituarily given direction.

Return

boolean:

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

GetIterations()

This action returns how many iterations the distance solver has gone through.

Return

integer:

GetOrder()

This action returns what type of simplex you are using currently.

Return

integer:

GetSimplex()

This action returns the simplex that you are using currently using an array of vertices.

Return

Libraries.Containers.Array:

Hash(Libraries.Compute.Vector3 vector)

This action returns a number that is an index to an array that contains randome vectors.

Parameters

Return

integer:

Initialize(Libraries.Compute.Matrix3 wrot0, Libraries.Compute.Vector3 pos0, Libraries.Game.Collision.Shapes.CollisionShape3D shape0, Libraries.Compute.Matrix3 wrot1, Libraries.Compute.Vector3 pos1, Libraries.Game.Collision.Shapes.CollisionShape3D shape1, number pmargin)

This action initializes the variables in this ConvexConvexDistanceSolver with variables that you passed in.

Parameters

LocalSupport(Libraries.Compute.Vector3 d, integer i)

This action returns a number that is an index to an array that contains randome vectors.

Parameters

Return

Libraries.Compute.Vector3:

SearchOrigin()

This action returns whether the two objects has collided or not.

Return

boolean:

SearchOrigin(Libraries.Compute.Vector3 initray)

This action returns whether the two objects has collided or not.

Parameters

Return

boolean:

SetOrder(integer order)

This action sets what type of simplex you are using currently.

Parameters

  • integer order

SolveSimplex2(Libraries.Compute.Vector3 ao, Libraries.Compute.Vector3 ab)

This action finds a support point in an arbituarily given direction.

Parameters

Return

boolean:

SolveSimplex3(Libraries.Compute.Vector3 ao, Libraries.Compute.Vector3 ab, Libraries.Compute.Vector3 ac)

This action finds and saves an vertex that could potentially be a part of a tetrahedron that will enclose the origin.

Parameters

Return

boolean:

SolveSimplex3a(Libraries.Compute.Vector3 ao, Libraries.Compute.Vector3 ab, Libraries.Compute.Vector3 ac, Libraries.Compute.Vector3 cabc)

This action initializes the variables in this ConvexConvexDistanceSolver with variables that you passed in.

Parameters

Return

boolean:

SolveSimplex4(Libraries.Compute.Vector3 ao, Libraries.Compute.Vector3 ab, Libraries.Compute.Vector3 ac, Libraries.Compute.Vector3 ad)

Support(Libraries.Compute.Vector3 d, Libraries.Game.Collision.Narrowphase.ConvexConvexVertex v)

This action finds and saves an vertex that could potentially be a part of a tetrahedron that will enclose the origin.

Parameters