TranslationalLimitMotor3D

Package: Libraries.Game.Physics.Joints · Inherits from: Libraries.Language.Object

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.

Actions

GetAccumulatedImpulse()

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

Returns

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.

Returns

number: the damping value.

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.

Returns

number: the limit softness value.

GetLowerLimit()

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

Returns

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.

Returns

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.

Returns

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

  • limitIndex integer: 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.

Returns

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

  • x number: The x direction of impulse.
  • y number: The y direction of impulse.
  • z number: 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

Returns

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.

Inherited Actions

3 actions from Libraries.Language.Object