Class TranslationalLimitMotor

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

public class TranslationalLimitMotor extends NativePhysicsObject
A motor based on Bullet's btTranslationalLimitMotor, used to control the translation 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
    TranslationalLimitMotor(long nativeId)
    Instantiate a motor.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.jme3.math.Vector3f
    getAccumulatedImpulse(com.jme3.math.Vector3f storeResult)
    Copy the accumulated impulse (native field: m_accumulatedImpulse).
    float
    Return this motor's damping (native field: m_damping).
    com.jme3.math.Vector3f
    getERP(com.jme3.math.Vector3f storeResult)
    Copy this motor's error-reduction parameters at the limits (native field: m_stopERP).
    float
    Return this motor's limit softness (native field: m_limitSoftness).
    com.jme3.math.Vector3f
    getLowerLimit(com.jme3.math.Vector3f storeResult)
    Copy this motor's constraint lower limits (native field: m_lowerLimit).
    com.jme3.math.Vector3f
    getMaxMotorForce(com.jme3.math.Vector3f storeResult)
    Copy this motor's maximum motor forces for normal conditions (native field: m_maxMotorForce).
    com.jme3.math.Vector3f
    getNormalCFM(com.jme3.math.Vector3f storeResult)
    Copy this motor's constraint-force mixing parameters for normal conditions (native field: m_normalCFM).
    com.jme3.math.Vector3f
    getOffset(com.jme3.math.Vector3f storeResult)
    Return the offset of the constraint frames (native field: m_currentLinearDiff).
    float
    Return this motor's restitution at the limits (native field: m_restitution).
    com.jme3.math.Vector3f
    getStopCFM(com.jme3.math.Vector3f storeResult)
    Copy this motor's constraint-force mixing parameters at the limits (native field: m_stopCFM).
    com.jme3.math.Vector3f
    getTargetVelocity(com.jme3.math.Vector3f storeResult)
    Copy this motor's target velocity (native field: m_targetVelocity).
    com.jme3.math.Vector3f
    getUpperLimit(com.jme3.math.Vector3f storeResult)
    Copy this motor's constraint upper limits (native field: m_upperLimit).
    boolean
    isEnabled(int axisIndex)
    Test whether the indexed axis is enabled (native field: m_enableMotor).
    void
    setAccumulatedImpulse(com.jme3.math.Vector3f accumulatedImpulse)
    Alter the accumulated impulse (native field: m_accumulatedImpulse).
    void
    setDamping(float damping)
    Alter this motor's damping (native field: m_damping).
    void
    setEnabled(int axisIndex, boolean enableMotor)
    Enable or disable the indexed axis (native field: m_enableMotor).
    void
    setERP(com.jme3.math.Vector3f erp)
    Alter this motor's error-reduction parameters at the limits (native field: m_stopERP).
    void
    setLimitSoftness(float limitSoftness)
    Alter the limit softness (native field: m_limitSoftness).
    void
    setLowerLimit(com.jme3.math.Vector3f lowerLimit)
    Alter this motor's constraint lower limits (native field: m_lowerLimit).
    void
    setMaxMotorForce(com.jme3.math.Vector3f maxForce)
    Alter this motor's maximum forces (native field: m_maxMotorForce).
    void
    setNormalCFM(com.jme3.math.Vector3f cfm)
    Alter this motor's constraint-force mixing parameters for normal conditions (native field: m_normalCFM).
    void
    setRestitution(float restitution)
    Alter this motor's restitution at the limits (native field: m_restitution).
    void
    setStopCFM(com.jme3.math.Vector3f cfm)
    Alter this motor's constraint-force mixing parameters at the limits (native field: m_stopCFM).
    void
    setTargetVelocity(com.jme3.math.Vector3f velocity)
    Alter this motor's target velocity (native field: m_targetVelocity).
    void
    setUpperLimit(com.jme3.math.Vector3f upperLimit)
    Alter this motor's constraint upper limits (native field: m_upperLimit).

    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

    • TranslationalLimitMotor

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

    • getAccumulatedImpulse

      public com.jme3.math.Vector3f getAccumulatedImpulse(com.jme3.math.Vector3f storeResult)
      Copy the accumulated impulse (native field: m_accumulatedImpulse).
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      a new vector (not null)
    • 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 com.jme3.math.Vector3f getERP(com.jme3.math.Vector3f storeResult)
      Copy this motor's error-reduction parameters at the limits (native field: m_stopERP).
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the error-reduction parameter for each axis (either storeResult or a new instance, not null)
    • getLimitSoftness

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

      public com.jme3.math.Vector3f getLowerLimit(com.jme3.math.Vector3f storeResult)
      Copy this motor's constraint lower limits (native field: m_lowerLimit).
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the lower limit for each axis (either storeResult or a new instance)
    • getMaxMotorForce

      public com.jme3.math.Vector3f getMaxMotorForce(com.jme3.math.Vector3f storeResult)
      Copy this motor's maximum motor forces for normal conditions (native field: m_maxMotorForce).
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the maximum force for each axis (either storeResult or a new instance)
    • getNormalCFM

      public com.jme3.math.Vector3f getNormalCFM(com.jme3.math.Vector3f storeResult)
      Copy this motor's constraint-force mixing parameters for normal conditions (native field: m_normalCFM).
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the mixing parameter for each axis (either storeResult or a new instance)
    • getOffset

      public com.jme3.math.Vector3f getOffset(com.jme3.math.Vector3f storeResult)
      Return the offset of the constraint frames (native field: m_currentLinearDiff).
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the offset (either storeResult or a new instance)
    • getRestitution

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

      public com.jme3.math.Vector3f getStopCFM(com.jme3.math.Vector3f storeResult)
      Copy this motor's constraint-force mixing parameters at the limits (native field: m_stopCFM).
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the mixing parameter for each axis (either storeResult or a new instance)
    • getTargetVelocity

      public com.jme3.math.Vector3f getTargetVelocity(com.jme3.math.Vector3f storeResult)
      Copy this motor's target velocity (native field: m_targetVelocity).
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the target velocity vector (either storeResult or a new instance)
    • getUpperLimit

      public com.jme3.math.Vector3f getUpperLimit(com.jme3.math.Vector3f storeResult)
      Copy this motor's constraint upper limits (native field: m_upperLimit).
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the upper limit for each axis (either storeResult or a new instance)
    • isEnabled

      public boolean isEnabled(int axisIndex)
      Test whether the indexed axis is enabled (native field: m_enableMotor).
      Parameters:
      axisIndex - which axis: 0→X, 1→Y, 2→Z
      Returns:
      true if enabled, otherwise false
    • setAccumulatedImpulse

      public void setAccumulatedImpulse(com.jme3.math.Vector3f accumulatedImpulse)
      Alter the accumulated impulse (native field: m_accumulatedImpulse).
      Parameters:
      accumulatedImpulse - the desired vector (not null, unaffected, default=(0,0,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)
    • setEnabled

      public void setEnabled(int axisIndex, boolean enableMotor)
      Enable or disable the indexed axis (native field: m_enableMotor).
      Parameters:
      axisIndex - which axis: 0→X, 1→Y, 2→Z
      enableMotor - true→enable, false→disable (default=false)
    • setERP

      public void setERP(com.jme3.math.Vector3f erp)
      Alter this motor's error-reduction parameters at the limits (native field: m_stopERP).
      Parameters:
      erp - the desired error-reduction parameter parameter for each axis (not null, unaffected, default=(0.2,0.2,0.2))
    • setLimitSoftness

      public void setLimitSoftness(float limitSoftness)
      Alter the limit softness (native field: m_limitSoftness).
      Parameters:
      limitSoftness - the desired limit softness (default=0.7)
    • setLowerLimit

      public void setLowerLimit(com.jme3.math.Vector3f lowerLimit)
      Alter this motor's constraint lower limits (native field: m_lowerLimit).
      Parameters:
      lowerLimit - the desired limit value for each axis (unaffected, not null, default=(0,0,0))
    • setMaxMotorForce

      public void setMaxMotorForce(com.jme3.math.Vector3f maxForce)
      Alter this motor's maximum forces (native field: m_maxMotorForce).
      Parameters:
      maxForce - the desired maximum force for each axis (not null, unaffected, default=(0,0,0))
    • setNormalCFM

      public void setNormalCFM(com.jme3.math.Vector3f cfm)
      Alter this motor's constraint-force mixing parameters for normal conditions (native field: m_normalCFM).
      Parameters:
      cfm - the desired mixing parameter for each axis (not null, unaffected, default=(0,0,0))
    • setRestitution

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

      public void setStopCFM(com.jme3.math.Vector3f cfm)
      Alter this motor's constraint-force mixing parameters at the limits (native field: m_stopCFM).
      Parameters:
      cfm - the desired mixing parameter for each axis (not null, unaffected, default=(0,0,0))
    • setTargetVelocity

      public void setTargetVelocity(com.jme3.math.Vector3f velocity)
      Alter this motor's target velocity (native field: m_targetVelocity).
      Parameters:
      velocity - the desired velocity vector (not null, unaffected, default=(0,0,0))
    • setUpperLimit

      public void setUpperLimit(com.jme3.math.Vector3f upperLimit)
      Alter this motor's constraint upper limits (native field: m_upperLimit).
      Parameters:
      upperLimit - the desired limit value for each axis (unaffected, not null, default=(0,0,0))