Package com.jme3.bullet.joints.motors
Class RotationMotor
java.lang.Object
com.jme3.bullet.NativePhysicsObject
com.jme3.bullet.joints.motors.RotationMotor
- All Implemented Interfaces:
Comparable<NativePhysicsObject>
A single-axis motor based on Bullet's btRotationalLimitMotor2, used to
control the rotation of a New6Dof constraint.
-
Field Summary
FieldsFields inherited from class com.jme3.bullet.NativePhysicsObject
loggerN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatget(MotorParam param) Return the value of the specified parameter.booleanTest whether the spring's damping is limited (native field: m_springDampingLimited).booleanTest whether the motor is enabled (native field: m_enableMotor).booleanTest whether the servo is enabled (native field: m_servoMotor).booleanTest whether the spring is enabled (native field: m_enableSpring).booleanTest whether the spring's stiffness is limited (m_springStiffnessLimited).voidset(MotorParam param, float value) Alter the specified parameter.voidsetDampingLimited(boolean limitDamping) Limit or unlimit the spring's damping (native field: m_springDampingLimited).voidsetMotorEnabled(boolean enableFlag) Enable or disable this motor (native field: m_enableMotor).voidsetServoEnabled(boolean enableFlag) Enable or disable the servo (native field: m_servoMotor).voidsetSpringEnabled(boolean enableFlag) Enable or disable the spring (native field: m_enableSpring).voidsetStiffnessLimited(boolean limitStiffness) Limit or unlimit the spring's stiffness (native field: m_springStiffnessLimited).Methods inherited from class com.jme3.bullet.NativePhysicsObject
compareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeId, setNativeIdNotTracked, toString, unassignNativeObject
-
Field Details
-
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
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
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)
-