Libraries.Game.Collision.Narrowphase.ConvexConvexSimplexSolver Documentation

This action finds the closest point on a object to the origin.

Inherits from: Libraries.Language.Object

Actions Documentation

AddVertex(Libraries.Compute.Vector3 w, Libraries.Compute.Vector3 p, Libraries.Compute.Vector3 q)

BackupClosest(Libraries.Compute.Vector3 v)

This action saves the closest vertex to the origin inside the "Vector3 v."

Parameters

Closest(Libraries.Compute.Vector3 v)

This action temporarily stores a vertex on the current simplex that is closest to the origin.

Parameters

Return

boolean:

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)

ComputePoints(Libraries.Compute.Vector3 p1, Libraries.Compute.Vector3 p2)

This action calls the action UpdateClosestVectorAndPoints and stores two different points temporarily to be used later. These two points can be anything that you know you will need later.

Parameters

EmptySimplex()

This action returns whether you have a simplex currently 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)

FullSimplex()

This action returns whether you have a tetrahedron as your current simplex.

Return

boolean:

GetCachedPointA()

This action returns whether you have a simplex currently or not.

Return

Libraries.Compute.Vector3:

GetCachedPointB()

This action tests whether a vertex is inside the current simplex.

Return

Libraries.Compute.Vector3:

GetCachedVector()

This action returns the maximum distance from the origin to a vertex in the simplex.

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

GetLastW()

This action updates the simplex.

Return

Libraries.Compute.Vector3:

GetNumberOfVertices()

This action returns the number of vertices there is in a simplex.

Return

number:

GetSimplexPointsP()

This action returns the number of vertices there is in a simplex.

Return

Libraries.Containers.Array:

GetSimplexPointsQ()

This action calls the action UpdateClosestVectorAndPoints and stores two different points temporarily to be used later. These two points can be anything that you know you will need later.

Return

Libraries.Containers.Array:

GetSimplexVectorW()

This action sets the number of vertices there is in a simplex.

Return

Libraries.Containers.Array:

InSimplex(Libraries.Compute.Vector3 w)

This action tests whether a vertex is inside the current simplex.

Parameters

Return

boolean:

IsCachedValidClosest()

if they are on opposite sides of the plane

Return

boolean:

MaxVertex()

This action returns the maximum distance from the origin to a vertex in the simplex.

Return

number:

NeedsUpdate()

This action updates the vertex on the current simplex that is closest to the origin and also updates the closest point from the current simplex to the origin.

Return

boolean:

ReduceVertices(Libraries.Game.Collision.Narrowphase.ConvexConvexSubSimplexClosestResult usedVerts)

This action ignores the vertices that are unused inside a ConvexConvesSubSimplexClosestResult class, which can hold up to 4 vertices.

Parameters

RemoveVertex(integer index)

This action removes a vertex from a simplex (which is the umbrella term for a point, a line, a triangle, or a tetrahedron).

Parameters

  • integer index

Reset()

This action resets the ConvexConvexSimplexSolver.

SetCachedPointA(Libraries.Compute.Vector3 point)

This action saves the closest vertex to the origin inside the "Vector3 v."

Parameters