Package com.jme3.bullet.joints.motors
Class TranslationalLimitMotor
java.lang.Object
com.jme3.bullet.NativePhysicsObject
com.jme3.bullet.joints.motors.TranslationalLimitMotor
- All Implemented Interfaces:
Comparable<NativePhysicsObject>
A motor based on Bullet's btTranslationalLimitMotor, used to control the
translation of a SixDofJoint.
-
Field Summary
Fields inherited from class com.jme3.bullet.NativePhysicsObject
loggerN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetAccumulatedImpulse
(Vector3f storeResult) Copy the accumulated impulse (native field: m_accumulatedImpulse).float
Return this motor's damping (native field: m_damping).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).getLowerLimit
(Vector3f storeResult) Copy this motor's constraint lower limits (native field: m_lowerLimit).getMaxMotorForce
(Vector3f storeResult) Copy this motor's maximum motor forces for normal conditions (native field: m_maxMotorForce).getNormalCFM
(Vector3f storeResult) Copy this motor's constraint-force mixing parameters for normal conditions (native field: m_normalCFM).Return the offset of the constraint frames (native field: m_currentLinearDiff).float
Return this motor's restitution at the limits (native field: m_restitution).getStopCFM
(Vector3f storeResult) Copy this motor's constraint-force mixing parameters at the limits (native field: m_stopCFM).getTargetVelocity
(Vector3f storeResult) Copy this motor's target velocity (native field: m_targetVelocity).getUpperLimit
(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
(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
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
(Vector3f lowerLimit) Alter this motor's constraint lower limits (native field: m_lowerLimit).void
setMaxMotorForce
(Vector3f maxForce) Alter this motor's maximum forces (native field: m_maxMotorForce).void
setNormalCFM
(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
(Vector3f cfm) Alter this motor's constraint-force mixing parameters at the limits (native field: m_stopCFM).void
setTargetVelocity
(Vector3f velocity) Alter this motor's target velocity (native field: m_targetVelocity).void
setUpperLimit
(Vector3f upperLimit) Alter this motor's constraint upper limits (native field: m_upperLimit).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
-
TranslationalLimitMotor
public TranslationalLimitMotor(long nativeId) Instantiate a motor. Used internally.- Parameters:
nativeId
- the ID of the pre-existing btTranslationalLimitMotor (not zero)
-
-
Method Details
-
getAccumulatedImpulse
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
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
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
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
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
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
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
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
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
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→ZenableMotor
- true→enable, false→disable (default=false)
-
setERP
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
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
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
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
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
Alter this motor's target velocity (native field: m_targetVelocity).- Parameters:
velocity
- the desired velocity vector (not null, unaffected, default=(0,0,0))
-
setUpperLimit
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))
-