Libraries.Game.Physics.CollisionSolver3D Documentation

This class contains actions that is necessary to compute how objects will react after a collision or after the objects have been constrained by a joint. The objects' reaction to physics is simulated by applying impulses to the objects based on collision and constraints on the objects.

Inherits from: Libraries.Language.Object

Actions Documentation

AddFrictionConstraint(Libraries.Compute.Vector3 normalAxis, integer solverBodyIDA, integer solverBodyIDB, integer frictionIndex, Libraries.Game.Collision.CollisionPoint3D cp, Libraries.Compute.Vector3 relativePosition1, Libraries.Compute.Vector3 relativePosition2, Libraries.Interface.Item3D body0, Libraries.Interface.Item3D body1, number relaxation)

This action makes a solver to take into account of the effects of friction during a collision.

Parameters

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)

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

InitializeSolverItem(Libraries.Game.Physics.SolverItem3D solverItem, Libraries.Interface.Item3D originalItem)

This action stores properties inside an Item3D class into a SolverItem3D so that you can access these properties quicker from the SolverItem3D.

Parameters

PrepareConstraints(Libraries.Game.Collision.LocalCollisionPoints3D manifold, Libraries.Game.Physics.CollisionSolverInformation3D info)

This action calculates the constraints between two colliding bodies that share the same LocalCollisionPoints3D.

Parameters

Reset()

This action sets the starting point of a bunch of random numbers is 0.

ResolveSingleCollisionCombined(Libraries.Game.Physics.SolverItem3D body1, Libraries.Game.Physics.SolverItem3D body2, Libraries.Game.Physics.SolverConstraint3D contactConstraint, Libraries.Game.Physics.CollisionSolverInformation3D solverInfo)

This action finds the impulse that should be applied to resolve collision for two objects by taking into account of friction and normal force.

Parameters

Return

number:

ResolveSingleFriction(Libraries.Game.Physics.SolverItem3D body1, Libraries.Game.Physics.SolverItem3D body2, Libraries.Game.Physics.SolverConstraint3D contactConstraint, Libraries.Game.Physics.CollisionSolverInformation3D solverInfo, number appliedNormalImpulse)

This action finds the frictional impulse that should be applied at a point to separate the two colliding objects. This action is used by the "SolveGroupIterations" action and the "SolveFriction" action.

Parameters

Return

number:

ResolveSplitPenetrationImpulse(Libraries.Game.Physics.SolverItem3D body1, Libraries.Game.Physics.SolverItem3D body2, Libraries.Game.Physics.SolverConstraint3D contactConstraint, Libraries.Game.Physics.CollisionSolverInformation3D solverInfo)

RestitutionCurve(number relativeVelocity, number restitution)

This action returns a restitution value that is correlated with the relative velocity for a more realistic simulation of physics.

Parameters

  • number relativeVelocity: The relative velocity between two objects.
  • number restitution: The original restitution.

Return

number:

Solve(Libraries.Interface.Item3D body0, Libraries.Interface.Item3D body1, Libraries.Game.Collision.CollisionPoint3D cp, Libraries.Game.Physics.CollisionSolverInformation3D info, integer iteration)

This action finds the impulse that should be applied to resolve collision for two objects without taking into account of friction such that the impulse can only be greater than 0.

Parameters

Return

number:

SolveCombinedContactFriction(Libraries.Interface.Item3D body0, Libraries.Interface.Item3D body1, Libraries.Game.Collision.CollisionPoint3D cp, Libraries.Game.Physics.CollisionSolverInformation3D info, integer iteration)

This action finds the impulse that should be applied to resolve collision for two objects taking into account of friction and normal force such that the impulse can only be greater than or equal to 0.

Parameters

Return

number:

SolveFriction(Libraries.Interface.Item3D body0, Libraries.Interface.Item3D body1, Libraries.Game.Collision.CollisionPoint3D cp, Libraries.Game.Physics.CollisionSolverInformation3D info, integer iteration)

This action finds the frictional impulse that should be applied at a point to separate the two colliding objects.

Parameters

Return

number:

SolveGroup(Libraries.Containers.Array<Libraries.Interface.Item3D> bodies, integer numBodies, Libraries.Containers.Array<Libraries.Game.Collision.LocalCollisionPoints3D> manifoldPtr, integer manifold_offset, integer numManifolds, Libraries.Containers.Array<Libraries.Game.Physics.Joints.Joint3D> joints, integer joints_offset, integer numJoints, Libraries.Game.Physics.CollisionSolverInformation3D infoGlobal)

This action solves the collision for a collision group.

Parameters

Return

number:

SolveGroupInternal(Libraries.Containers.Array<Libraries.Interface.Item3D> bodies, integer numBodies, Libraries.Containers.Array<Libraries.Game.Collision.LocalCollisionPoints3D> manifoldPtr, integer manifold_offset, integer numManifolds, Libraries.Containers.Array<Libraries.Game.Physics.Joints.Joint3D> joints, integer joints_offset, integer numJoints, Libraries.Game.Physics.CollisionSolverInformation3D infoGlobal)

This action is used to solve collision of objects inside a CollisionGroup3D. This action is used by the action "SolveGroup."

Parameters

Return

number:

SolveGroupIterations(Libraries.Containers.Array<Libraries.Interface.Item3D> bodies, integer numBodies, Libraries.Containers.Array<Libraries.Game.Collision.LocalCollisionPoints3D> manifoldPtr, integer manifold_offset, integer numManifolds, Libraries.Containers.Array<Libraries.Game.Physics.Joints.Joint3D> joints, integer joints_offset, integer numJoints, Libraries.Game.Physics.CollisionSolverInformation3D infoGlobal)

This action is used by the action "SolveGroupInternal" to randomize the collision points and the constraints at these collision points in arrays.

Parameters

Return

number:

SolveGroupSetup(Libraries.Containers.Array<Libraries.Interface.Item3D> bodies, integer numBodies, Libraries.Containers.Array<Libraries.Game.Collision.LocalCollisionPoints3D> manifoldPtr, integer manifold_offset, integer numManifolds, Libraries.Containers.Array<Libraries.Game.Physics.Joints.Joint3D> joints, integer joints_offset, integer numJoints, Libraries.Game.Physics.CollisionSolverInformation3D infoGlobal)

This action computes the constraints of objects inside a CollisionGroup3D during a collision.

Parameters

Return

number: