Package com.jme3.bullet.joints.motors
Class TranslationMotor
java.lang.Object
com.jme3.bullet.NativePhysicsObject
com.jme3.bullet.joints.motors.TranslationMotor
- All Implemented Interfaces:
Comparable<NativePhysicsObject>
A 3-axis motor based on Bullet's btTranslationalLimitMotor2, used to control
the translation of a New6Dof constraint.
-
Field Summary
Fields inherited from class com.jme3.bullet.NativePhysicsObject
loggerN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.jme3.math.Vector3f
get
(MotorParam param, com.jme3.math.Vector3f storeResult) Copy the specified parameter of this motor.boolean
isDampingLimited
(int axisIndex) Test whether the indexed spring's damping is limited (m_springDampingLimited).boolean
isMotorEnabled
(int axisIndex) Test whether the indexed motor is enabled (m_enableMotor).boolean
isServoEnabled
(int axisIndex) Test whether the indexed servo is enabled (m_servoMotor).boolean
isSpringEnabled
(int axisIndex) Test whether the indexed spring is enabled (m_enableSpring).boolean
isStiffnessLimited
(int axisIndex) Test whether the indexed spring's stiffness is limited (m_springStiffnessLimited).void
set
(MotorParam param, com.jme3.math.Vector3f values) Alter the specified parameter of this motor.void
setDampingLimited
(int axisIndex, boolean limitDamping) Limit or unlimit the damping of the indexed spring (m_springDampingLimited).void
setMotorEnabled
(int axisIndex, boolean enableFlag) Enable or disable the indexed axis (m_enableMotor).void
setServoEnabled
(int axisIndex, boolean enableFlag) Enable or disable the indexed servo (m_servoMotor).void
setSpringEnabled
(int axisIndex, boolean enableFlag) Enable or disable the indexed spring (m_enableSpring).void
setStiffnessLimited
(int axisIndex, boolean limitFlag) Limit or unlimit the stiffness of the indexed spring (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
-
TranslationMotor
public TranslationMotor(long nativeId) Instantiate a motor. Used internally.- Parameters:
nativeId
- the ID of a pre-existing btTranslationalLimitMotor2 (not zero)
-
-
Method Details
-
get
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
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→ZlimitDamping
- 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→ZenableFlag
- 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→ZenableFlag
- 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→ZenableFlag
- 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→ZlimitFlag
- true→limit, false→don't limit (default=false)
-