Class RotationMotor

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

public class RotationMotor extends NativePhysicsObject
A single-axis motor based on Bullet's btRotationalLimitMotor2, used to control the rotation of a New6Dof constraint.
  • Field Details

    • logger

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

    • RotationMotor

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

    • get

      public float get(MotorParam param)
      Return the value of the specified parameter.
      Parameters:
      param - which parameter (not null)
      Returns:
      the parameter value
    • isDampingLimited

      public boolean isDampingLimited()
      Test whether the spring's damping is limited (native field: m_springDampingLimited).
      Returns:
      true if limited, otherwise false
    • isMotorEnabled

      public boolean isMotorEnabled()
      Test whether the motor is enabled (native field: m_enableMotor).
      Returns:
      true if enabled, otherwise false
    • isServoEnabled

      public boolean isServoEnabled()
      Test whether the servo is enabled (native field: m_servoMotor).
      Returns:
      true if enabled, otherwise false
    • isSpringEnabled

      public boolean isSpringEnabled()
      Test whether the spring is enabled (native field: m_enableSpring).
      Returns:
      true if enabled, otherwise false
    • isStiffnessLimited

      public boolean isStiffnessLimited()
      Test whether the spring's stiffness is limited (m_springStiffnessLimited).
      Returns:
      true if limited, otherwise false
    • set

      public void set(MotorParam param, float value)
      Alter the specified parameter.
      Parameters:
      param - which parameter (not null)
      value - the desired parameter value
    • setDampingLimited

      public void setDampingLimited(boolean limitDamping)
      Limit or unlimit the spring's damping (native field: m_springDampingLimited).
      Parameters:
      limitDamping - true→limit, false→don't limit (default=false)
    • setMotorEnabled

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

      public void setServoEnabled(boolean enableFlag)
      Enable or disable the servo (native field: m_servoMotor). This setting has no effect if the motor is disabled.
      Parameters:
      enableFlag - true→enable, false→disable (default=false)
    • setSpringEnabled

      public void setSpringEnabled(boolean enableFlag)
      Enable or disable the spring (native field: m_enableSpring).
      Parameters:
      enableFlag - true→enable, false→disable (default=false)
    • setStiffnessLimited

      public void setStiffnessLimited(boolean limitStiffness)
      Limit or unlimit the spring's stiffness (native field: m_springStiffnessLimited).
      Parameters:
      limitStiffness - true→limit, false→don't limit (default=false)