Libraries.Game.Physics.SolverConstraint3D Documentation

This class is used by CollisionSolver3D to store all of the criteria, ex. the direction that one object should go relative to another object.

Inherits from: Libraries.Language.Object

Variables Table

VariablesDescription
integer SOLVER_CONTACT
integer SOLVER_FRICTION

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)

GetAngularComponentA()

This action returns the direction (global coordinates) at which an angular impulse should be applied due to the normal impulse on object A.

Return

Libraries.Compute.Vector3: the direction (global coordinates) at which an angular impulse should be applied due to the normal impulse on object A.

GetAngularComponentB()

This action gets the direction (global coordinates) at which an angular impulse should be applied due to the normal impulse on object B.

Return

Libraries.Compute.Vector3: the direction (global coordinates) at which an angular impulse should be applied due to the normal impulse on object B.

GetAppliedImpulse()

This action gets the impulse that is needed to separate the two colliding objects.

Return

number: the impulse that is needed to separate the two colliding objects.

GetAppliedPushImpulse()

This action gets the impulse that is needed to stop the two colliding objects from penetrating each other.

Return

number: the impulse that is needed to stop the two colliding objects from penetrating each other.

GetBodyIDA()

This action gets if the first object would be responding to forces/torques (id = -2) or not (id = -1).

Return

integer: the ID of the first object.

GetBodyIDB()

This action gets if the second object would be responding to forces/torques (id = -2) or not (id = -1).

Return

integer: the ID of the second object.

GetConstraintType()

This action gets the solver type.

Return

integer: whether the solver is going to be a friction solver or a contact solver.

GetContactNormal()

This action returns the collision normal between two colliding objects.

Return

Libraries.Compute.Vector3: the collision normal between two colliding objects.

GetFriction()

This action gets the friction between the two colliding objects.

Return

number: the coefficient of friction.

GetFrictionIndex()

This action gets the friction index.

Return

integer: the friction index.

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

GetJacobianDiagonalABInverse()

This action gets a number that is used to scale the impulse that is used to avoid penetration of the two objects and the impulse that is used to move the two objects apart. These impulses will be applied along the collision normal between the two objects.

Return

number:

GetOriginalContactPoint()

This action gets the collision point that is inside this SolverConstraint3D class.

Return

Libraries.Game.Collision.CollisionPoint3D: the collision point inside this SolverConstraint3D class.

GetPenetration()

This action gets what the current penetration between the two objects is.

Return

number: current penetration between the two objects is.

GetRelativePosition1CrossNormal()

This action returns the cross product of a vector from the collision point to the center of the first object and the collision normal.

Return

Libraries.Compute.Vector3: the cross product of a vector from the collision point to the center of the first object and the collision normal.

GetRelativePosition2CrossNormal()

This action returns the cross product of a vector from the collision point to the center of the second object and the collision normal.

Return

Libraries.Compute.Vector3: the cross product of a vector from the collision point to the center of the second object and the collision normal.

GetRestitution()

This action gets the restitution between the two colliding objects.

Return

number: the coefficient of restitution.

SetAngularComponentA(Libraries.Compute.Vector3 vector)

This action sets the direction (global coordinates) at which an angular impulse should be applied due to the normal impulse on object A.

Parameters

  • Libraries.Compute.Vector3: the direction (global coordinates) at which an angular impulse should be applied due to the normal impulse on object A.

SetAngularComponentB(Libraries.Compute.Vector3 vector)

This action sets the direction (global coordinates) at which an angular impulse should be applied due to the normal impulse on object B.

Parameters

  • Libraries.Compute.Vector3: the direction (global coordinates) at which an angular impulse should be applied due to the normal impulse on object B.

SetAppliedImpulse(number impulse)

This action sets the impulse that is needed to separate the two colliding objects.

Parameters

  • number impulse: the impulse that is needed to separate the two colliding objects.

SetAppliedPushImpulse(number impulse)

This action sets the impulse that is needed to stop the two colliding objects from penetrating each other.

Parameters

  • number impulse: The impulse that is needed to stop the two colliding objects from penetrating each other.

SetBodyIDA(integer id)

This action sets if the first object would be responding to forces/torques (id = -2) or not (id = -1).

Parameters

  • integer id: ID of the first object.

SetBodyIDB(integer id)

This action sets if the second object would be responding to forces/torques (id = -2) or not (id = -1).

Parameters

  • integer id: ID of the second object.

SetConstraintType(integer type)

This action sets whether the solver is going to be a friction solver or a contact solver.

Parameters

  • integer type: whether the solver is going to be a friction solver or a contact solver.

SetContactNormal(Libraries.Compute.Vector3 normal)

This action sets the collision normal between two colliding objects.

Parameters

SetFriction(number friction)

This action sets the friction between the two colliding objects.

Parameters

  • number friction: The coefficient of friction.

SetFrictionIndex(integer index)

This action sets the friction index.

Parameters

  • integer index: the friction index

SetJacobianDiagonalABInverse(number jacobian)

This action sets a number that is used to scale the impulse that is used to avoid penetration of the two objects and the impulse that is used to move the two objects apart. These impulses will be applied along the collision normal between the two objects.

Parameters

  • number jacobian

SetOriginalContactPoint(Libraries.Game.Collision.CollisionPoint3D contactPoint)

This action stores a collision point inside this SolverConstraint3D class.

Parameters

SetPenetration(number penetration)

This action records what the current penetration between the two objects is.

Parameters

  • number penetration: The current penetration between the two objects is.

SetRelativePosition1CrossNormal(Libraries.Compute.Vector3 vector)

This action sets the cross product of a vector from the collision point to the center of the first object and the collision normal.

Parameters

  • Libraries.Compute.Vector3: cross product of a vector from the collision point to the center of the first object and the collision normal.

SetRelativePosition2CrossNormal(Libraries.Compute.Vector3 vector)

This action sets the cross product of a vector from the collision point to the center of the second object and the collision normal.

Parameters

  • Libraries.Compute.Vector3: the cross product of a vector from the collision point to the center of the second object and the collision normal.

SetRestitution(number restitution)

This action sets the restitution between the two colliding objects.

Parameters

  • number restitution: The coefficient of restitution.