Class TranslationMotor

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

public class TranslationMotor extends NativePhysicsObject
A 3-axis motor based on Bullet's btTranslationalLimitMotor2, used to control the translation of a New6Dof constraint.
  • Field Details

    • logger

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

    • TranslationMotor

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

    • get

      public Vector3f get(MotorParam param, Vector3f storeResult)
      Copy the specified parameter of this motor.
      Parameters:
      param - which parameter (not null)
      storeResult - storage for the result (modified if not null)
      Returns:
      the parameter value for each axis (either storeResult or a new instance)
    • isDampingLimited

      public boolean isDampingLimited(int axisIndex)
      Test whether the indexed spring's damping is limited (m_springDampingLimited).
      Parameters:
      axisIndex - which axis: 0→X, 1→Y, 2→Z
      Returns:
      true if limited, otherwise false
    • isMotorEnabled

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

      public boolean isServoEnabled(int axisIndex)
      Test whether the indexed servo is enabled (m_servoMotor).
      Parameters:
      axisIndex - which axis: 0→X, 1→Y, 2→Z
      Returns:
      true if enabled, otherwise false
    • isSpringEnabled

      public boolean isSpringEnabled(int axisIndex)
      Test whether the indexed spring is enabled (m_enableSpring).
      Parameters:
      axisIndex - which axis: 0→X, 1→Y, 2→Z
      Returns:
      true if enabled, otherwise false
    • isStiffnessLimited

      public boolean isStiffnessLimited(int axisIndex)
      Test whether the indexed spring's stiffness is limited (m_springStiffnessLimited).
      Parameters:
      axisIndex - which axis: 0→X, 1→Y, 2→Z
      Returns:
      true if limited, otherwise false
    • set

      public void set(MotorParam param, Vector3f values)
      Alter the specified parameter of this motor.
      Parameters:
      param - which parameter (not null)
      values - the desired parameter value for each axis (not null, unaffected)
    • setDampingLimited

      public void setDampingLimited(int axisIndex, boolean limitDamping)
      Limit or unlimit the damping of the indexed spring (m_springDampingLimited).
      Parameters:
      axisIndex - which axis: 0→X, 1→Y, 2→Z
      limitDamping - true→limit, false→don't limit (default=false)
    • setMotorEnabled

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

      public void setServoEnabled(int axisIndex, boolean enableFlag)
      Enable or disable the indexed servo (m_servoMotor). This setting has no effect if the corresponding axis is disabled.
      Parameters:
      axisIndex - which axis: 0→X, 1→Y, 2→Z
      enableFlag - true→enable, false→disable (default=false)
    • setSpringEnabled

      public void setSpringEnabled(int axisIndex, boolean enableFlag)
      Enable or disable the indexed spring (m_enableSpring).
      Parameters:
      axisIndex - which axis: 0→X, 1→Y, 2→Z
      enableFlag - true→enable, false→disable (default=false)
    • setStiffnessLimited

      public void setStiffnessLimited(int axisIndex, boolean limitFlag)
      Limit or unlimit the stiffness of the indexed spring (m_springStiffnessLimited).
      Parameters:
      axisIndex - which axis: 0→X, 1→Y, 2→Z
      limitFlag - true→limit, false→don't limit (default=false)