Class RotationalLimitMotor

java.lang.Object
com.jme3.bullet.NativePhysicsObject
com.jme3.bullet.joints.motors.RotationalLimitMotor
All Implemented Interfaces:
Comparable<NativePhysicsObject>

public class RotationalLimitMotor extends NativePhysicsObject
A motor based on Bullet's btRotationalLimitMotor, used to control the rotation of a SixDofJoint.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Logger
    message logger for this class

    Fields inherited from class com.jme3.bullet.NativePhysicsObject

    loggerN
  • Constructor Summary

    Constructors
    Constructor
    Description
    RotationalLimitMotor(long nativeId)
    Instantiate a motor.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    Return the accumulated impulse (native field: m_accumulatedImpulse).
    float
    Return this motor's current rotation angle (native field: m_currentPosition).
    float
    Return this motor's damping (native field: m_damping).
    float
    Return this motor's error-reduction parameter at the limits (native field: m_stopERP).
    float
    Return this motor's limit softness (native field: m_limitSoftness).
    float
    Return this motor's constraint lower limit (native field: m_loLimit).
    float
    Return the limit maximum force (native field: m_maxLimitForce).
    float
    Return this motor's maximum force for normal conditions (native field: m_maxMotorForce).
    float
    Return this motor's constraint-force mixing parameter for normal conditions (native field: m_normalCFM).
    float
    Return this motor's restitution at the limits (native field: m_bounce).
    float
    Return this motor's constraint-force mixing parameter at the limits (native field: m_stopCFM).
    float
    Return this motor's target velocity (native field: m_targetVelocity).
    float
    Return this motor's constraint upper limit (native field: m_hiLimit).
    boolean
    Test whether this motor is enabled (native field: m_enableMotor).
    void
    setAccumulatedImpulse(float accumulatedImpulse)
    Alter the accumulated impulse (native field: m_accumulatedImpulse).
    void
    setDamping(float damping)
    Alter this motor's damping (native field: m_damping).
    void
    setEnableMotor(boolean enableMotor)
    Enable or disable this motor (native field: m_enableMotor).
    void
    setERP(float erp)
    Alter this motor's error-reduction parameter at the limits (native field: m_stopERP).
    void
    setLimitSoftness(float limitSoftness)
    Alter this motor's limit softness (native field: m_limitSoftness).
    void
    setLowerLimit(float lowerLimit)
    Alter this motor's constraint lower limit (native field: m_loLimit).
    void
    setMaxLimitForce(float maxLimitForce)
    Alter the limit maximum force (native field: m_maxLimitForce).
    void
    setMaxMotorForce(float maxMotorForce)
    Alter this motor's maximum force (native field: m_maxMotorForce).
    void
    setNormalCFM(float cfm)
    Alter this motor's constraint-force mixing parameter for normal conditions (native field: m_normalCFM).
    void
    setRestitution(float restitution)
    Alter this motor's restitution at the limits (native field: m_bounce).
    void
    setStopCFM(float cfm)
    Alter this motor's constraint-force mixing parameter at the limits (native field: m_stopCFM).
    void
    setTargetVelocity(float targetVelocity)
    Alter this motor's target velocity (native field: m_targetVelocity).
    void
    setUpperLimit(float upperLimit)
    Alter this motor's constraint upper limit (native field: m_hiLimit).

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • logger

      public static final Logger logger
      message logger for this class
  • Constructor Details

    • RotationalLimitMotor

      public RotationalLimitMotor(long nativeId)
      Instantiate a motor. Used internally.
      Parameters:
      nativeId - the ID of the pre-existing btRotationalLimitMotor (not zero)
  • Method Details

    • getAccumulatedImpulse

      public float getAccumulatedImpulse()
      Return the accumulated impulse (native field: m_accumulatedImpulse).
      Returns:
      the total impulse
    • getAngle

      public float getAngle()
      Return this motor's current rotation angle (native field: m_currentPosition).
      Returns:
      the angle (in radians)
    • getDamping

      public float getDamping()
      Return this motor's damping (native field: m_damping).
      Returns:
      the viscous damping ratio (0→no damping, 1→critically damped)
    • getERP

      public float getERP()
      Return this motor's error-reduction parameter at the limits (native field: m_stopERP).
      Returns:
      the error-reduction parameter (≥0)
    • getLimitSoftness

      public float getLimitSoftness()
      Return this motor's limit softness (native field: m_limitSoftness).
      Returns:
      the limit softness (or relaxation factor)
    • getLowerLimit

      public float getLowerLimit()
      Return this motor's constraint lower limit (native field: m_loLimit).
      Returns:
      the limit value
    • getMaxLimitForce

      public float getMaxLimitForce()
      Return the limit maximum force (native field: m_maxLimitForce).
      Returns:
      the maximum force on the limit (default=300)
    • getMaxMotorForce

      public float getMaxMotorForce()
      Return this motor's maximum force for normal conditions (native field: m_maxMotorForce).
      Returns:
      the maximum force
    • getNormalCFM

      public float getNormalCFM()
      Return this motor's constraint-force mixing parameter for normal conditions (native field: m_normalCFM).
      Returns:
      the mixing parameter (≥0)
    • getRestitution

      public float getRestitution()
      Return this motor's restitution at the limits (native field: m_bounce).
      Returns:
      the restitution (bounce) factor
    • getStopCFM

      public float getStopCFM()
      Return this motor's constraint-force mixing parameter at the limits (native field: m_stopCFM).
      Returns:
      the mixing parameter (≥0)
    • getTargetVelocity

      public float getTargetVelocity()
      Return this motor's target velocity (native field: m_targetVelocity).
      Returns:
      the target velocity (in radians per second)
    • getUpperLimit

      public float getUpperLimit()
      Return this motor's constraint upper limit (native field: m_hiLimit).
      Returns:
      the limit value
    • isEnableMotor

      public boolean isEnableMotor()
      Test whether this motor is enabled (native field: m_enableMotor).
      Returns:
      true if enabled, otherwise false
    • setAccumulatedImpulse

      public void setAccumulatedImpulse(float accumulatedImpulse)
      Alter the accumulated impulse (native field: m_accumulatedImpulse).
      Parameters:
      accumulatedImpulse - the desired total (default=0)
    • setDamping

      public void setDamping(float damping)
      Alter this motor's damping (native field: m_damping).
      Parameters:
      damping - the desired viscous damping ratio (0→no damping, 1→critically damped, default=1)
    • setEnableMotor

      public void setEnableMotor(boolean enableMotor)
      Enable or disable this motor (native field: m_enableMotor).
      Parameters:
      enableMotor - true→enable, false→disable (default=false)
    • setERP

      public void setERP(float erp)
      Alter this motor's error-reduction parameter at the limits (native field: m_stopERP).
      Parameters:
      erp - the desired error tolerance at limits (≥0, default=0.2)
    • setLimitSoftness

      public void setLimitSoftness(float limitSoftness)
      Alter this motor's limit softness (native field: m_limitSoftness).
      Parameters:
      limitSoftness - the desired limit softness (or relaxation factor) (default=0.5)
    • setLowerLimit

      public void setLowerLimit(float lowerLimit)
      Alter this motor's constraint lower limit (native field: m_loLimit).
      Parameters:
      lowerLimit - the desired limit value (default=1)
    • setMaxLimitForce

      public void setMaxLimitForce(float maxLimitForce)
      Alter the limit maximum force (native field: m_maxLimitForce).
      Parameters:
      maxLimitForce - the desired maximum force on the limit (default=300)
    • setMaxMotorForce

      public void setMaxMotorForce(float maxMotorForce)
      Alter this motor's maximum force (native field: m_maxMotorForce).
      Parameters:
      maxMotorForce - the desired maximum force (default=6)
    • setNormalCFM

      public void setNormalCFM(float cfm)
      Alter this motor's constraint-force mixing parameter for normal conditions (native field: m_normalCFM).
      Parameters:
      cfm - the desired mixing parameter (≥0, default=0)
    • setRestitution

      public void setRestitution(float restitution)
      Alter this motor's restitution at the limits (native field: m_bounce).
      Parameters:
      restitution - the desired restitution (bounce) factor (default=0)
    • setStopCFM

      public void setStopCFM(float cfm)
      Alter this motor's constraint-force mixing parameter at the limits (native field: m_stopCFM).
      Parameters:
      cfm - the desired mixing parameter (≥0, default=0)
    • setTargetVelocity

      public void setTargetVelocity(float targetVelocity)
      Alter this motor's target velocity (native field: m_targetVelocity).
      Parameters:
      targetVelocity - the desired target velocity (in radians per second, default=0)
    • setUpperLimit

      public void setUpperLimit(float upperLimit)
      Alter this motor's constraint upper limit (native field: m_hiLimit).
      Parameters:
      upperLimit - the desired limit value (default=-1)