Libraries.Game.Physics.Joints.TranslationalLimitMotor3D Documentation

This class stores information of how much a 3D joint (so that the body can slide along an axis and also rotate around this axis) can slide and rotate.

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)

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)

GetAccumulatedImpulse()

This action returns how much impulse has been applied to the object because of this joint.

Return

Libraries.Compute.Vector3: how much impulse has been applied to the object because of this joint.

GetDamping()

This action returns how fast you want the slider to stop oscillating when the slider is trying to reach the target position. A number that is closer to 1 means that you don't want the slider to ever oscillate. A number that is closer to 0 means that you are allowing the slider to oscillate forever in the extreme case.

Return

number: the damping value.

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

GetLimitSoftness()

This action returns how much you care about if the slider goes out of the range of the position limit. A number that is closer to 1 means that you really don't want the slider to go out of the range. A number that is closer to 0 means that you don't care if the slider goes out of the position limit.

Return

number: the limit softness value.

GetLowerLimit()

This action returns the minimum position that the sliding object can be at.

Return

Libraries.Compute.Vector3: the minimum position that the sliding object can be at.

GetRestitution()

This action returns a number that tells you how fast you would want the slider to correct its velocity. 0 means that you will ignore the velocity error between the slider and our desired velocity for the slider to go, 1 means that you want to correct the velocity right away.

Return

number: how fast you would want the slider to correct its velocity.

GetUpperLimit()

This action returns the maximum position that the sliding object can be at.

Return

Libraries.Compute.Vector3: the maximum position that the sliding object can be at.

IsLimited(integer limitIndex)

This action lets you know if any of the sliding has been limited. When upper limit < lower limit: the axis is free; when upper limit = lower limit: the axis is fixed; when upper limit > lower limit: the axis is limited between lower and upper limits.

Parameters

  • integer limitIndex: The indicator of which axis you want to check, 0 for x, 1 for y, and 2 for z. Attrubute: Returns 0 there is no limit, 1 the axis that you are checking has a limit set.

Return

boolean:

Set(Libraries.Game.Physics.Joints.TranslationalLimitMotor3D other)

This action sets the values inside this TranslationalLimitMotor3D using another TranslationalLimitMotor3D.

Parameters

SetAccumulatedImpulse(number x, number y, number z)

This action sets the total amount of impulse that is applied to the objects to make sure that this joint stays intact.

Parameters

  • number x: The x direction of impulse.
  • number y: The y direction of impulse.
  • number z: The z direction of impulse.

SetLowerLimit(Libraries.Compute.Vector3 limit)

This action sets the minimum position that the sliding object can be at.

Parameters

SetUpperLimit(Libraries.Compute.Vector3 limit)

This action sets the maximum position that the sliding object can be at.

Parameters

SolveLinearAxis(number timeStep, number jacDiagABInv, Libraries.Interface.Item3D body1, Libraries.Compute.Vector3 pointInA, Libraries.Interface.Item3D body2, Libraries.Compute.Vector3 pointInB, integer limitIndex, Libraries.Compute.Vector3 axisNormalOnA, Libraries.Compute.Vector3 anchorPos)

This action makes sure that the bodies joined together by this TranslationalLimitMotor is at where they are supposed to be based on their translational limits.

Parameters

Return

number: the velocity that you want to add to the current velocity to make sure that the slider is within the position range that we want it to be.