Libraries.Game.Physics.Joints.RotationalLimitMotor3D Documentation
This class stores information of how to control a joint via a motor.
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
- Libraries.Language.Object: The object to compare to.
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
- Libraries.Language.Object: The to be compared.
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)
GetBounce()
This action returns a number that tells you how quick the motor will stop oscillating once that motor has reached its desired position. Having a higher number means there will be more oscillation.
Return
number: how quick the motor will stop oscillating.
GetCurrentLimit()
This action returns the state of the motor's angle right now. 0 means that the motor's angle is in range or that there wasn't a limit set in the first place. 1 means that the motor's angle is lower than its lowest limit. 2 means that the motor's angle is higher than its highest limit.
Return
integer: the state of the motor's angle.
GetCurrentLimitError()
This action tells you how much over or under the current angle that the motor is in right now to the correct range of the motor's angles.
Return
number: how much over or under the current angle that the motor is in right now to the correct range.
GetERP()
This action returns the error tolerance factor when joint is at its angular limit. When this ERP gets closer to 1, that means you will not allow the motor to have any angle that is outside the limit range. When this ERP gets closer to 0 that means you will ignore all of the errors.
Return
number: the error tolerance factor when joint is at its angular limit.
GetEnableMotor()
This action tells you whether the motor is allowed to turn or not.
Return
boolean: 0 if motor won't turn, 1 if the motor will turn.
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()
GetHiLimit()
This action returns the highest angle that this motor can rotate to.
Return
number: the highest angle that this motor can rotate to.
GetLimitSoftness()
This action returns a number that tells you how quick you would like to correct your motor's speed if there is a speed change. When this number gets closer to 1 that means you would want the motor's speed to go as quickly as possible to the desired speed. When this number gets closer to 0 that means you will ignore the motor's speed error.
Return
number: how quick you would like to correct your motor's speed if there is a speed change.
GetLoLimit()
This action returns the lowest angle that this motor can rotate to.
Return
number: the lowest angle that this motor can rotate to.
GetMaxMotorForce()
This action returns what is the maximum force that this motor will exhibit on an object attached to this motor.
Return
number: the maximum force that this motor will exhibit on an object.
GetTargetVelocity()
This action returns the velocity that you want the motor to go.
Return
number: the velocity that you want the motor to go.
IsLimited()
This action lets you know if you have set a limit or not.
Return
boolean: 0 if you have not set a limit, 1 if you have set a limit.
NeedApplyTorques()
This action lets you know if you need to apply torque to any of the objects associated with this RotationalLimitMotor3D because either the error in calculation is not 0 or motor is enabled.
Return
boolean: 0 if this motor is not enabled so there will be no torque from this motor, 1 when there will be torque from this motor.
Set(Libraries.Game.Physics.Joints.RotationalLimitMotor3D other)
This action sets the values of this RotationalLimitMotor3D using another RotationalLimitMotor3D.
Parameters
- Libraries.Game.Physics.Joints.RotationalLimitMotor3D: The other RotationalLimitMotor3D.
SetAccumulatedImpulse(number x)
This action sets the amount of impulse that you have applied so far.
Parameters
- number x: The amount of impulse that you have applied so far.
SetHiLimit(number limit)
This action sets the highest angle that this motor can rotate to.
Parameters
- number limit: The highest angle that this motor can rotate to.
SetLoLimit(number limit)
This action sets the lowest angle that this motor can rotate to.
Parameters
- number limit: The lowest angle that this motor can rotate to.
SolveAngularLimits(number timeStep, Libraries.Compute.Vector3 axis, number jacDiagABInv, Libraries.Interface.Item3D body0, Libraries.Interface.Item3D body1)
This action makes sure that the angular limits of the motors are met.
Parameters
- number timeStep
- Libraries.Compute.Vector3
- number jacDiagABInv
- Libraries.Interface.Item3D
- Libraries.Interface.Item3D
Return
number: the impulse that should be applied.
TestLimitValue(number testValue)
This action lets you know if a testValue that you passed in is within the limits of this RotationalLimitMotor3D.
Parameters
- number testValue: The test value that you want to see if its within limit.
Return
integer: 0 if the limits aren't set in the first place or test value is within limit, 1 if test value is lower than the lowest limit, 2 if the test value is higher than the highest limit.