Package com.github.stephengold.joltjni
Class MotorSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.MotorSettings
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<ConstJoltPhysicsObject>
Settings used to construct a constraint motor.
-
Method Summary
Modifier and TypeMethodDescriptionAccess the underlyingConstraint, if any.Access the underlyingConstraintSettings, if any.floatReturn the maximum force to apply in a linear constraint.floatReturn the maximum torque to apply in an angular constraint.floatReturn the minimum force to apply in a linear constraint.floatReturn the minimum torque to apply in an angular constraint.Access the settings for the spring used to drive to the position target.booleanisValid()Test whether the settings are valid.voidsetForceLimit(float limit) Alter both force limits of a linear motor to be symmetrical.voidsetForceLimits(float min, float max) Alter both force limits of a linear motor.voidsetMaxForceLimit(float force) Alter the maximum force to apply in a linear constraint.voidsetMaxTorqueLimit(float torque) Alter the maximum torque to apply in an angular constraint.voidsetMinForceLimit(float force) Alter the minimum force to apply in a linear constraint.voidsetMinTorqueLimit(float torque) Alter the minimum torque to apply in an angular constraint.voidsetTorqueLimit(float limit) Alter both torque limits of an angular motor to be symmetrical.voidsetTorqueLimits(float min, float max) Alter both torque limits of an angular motor.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, va
-
Method Details
-
getConstraint
Access the underlyingConstraint, if any.- Returns:
- the pre-existing instance, or null if none
-
getConstraintSettings
Access the underlyingConstraintSettings, if any.- Returns:
- the pre-existing instance, or null if none
-
getMaxForceLimit
public float getMaxForceLimit()Return the maximum force to apply in a linear constraint. Ignored in an angular motor. The settings are unaffected. (native attribute: mMaxForceLimit)- Returns:
- the amount of force (in Newtons, typically positive)
-
getMaxTorqueLimit
public float getMaxTorqueLimit()Return the maximum torque to apply in an angular constraint. Ignored in a linear motor. The settings are unaffected. (native attribute: mMaxTorqueLimit)- Returns:
- the amount of torque (in Newton-meters, typically positive)
-
getMinForceLimit
public float getMinForceLimit()Return the minimum force to apply in a linear constraint. Ignored in an angular motor. The settings are unaffected. (native attribute: mMinForceLimit)- Returns:
- the amount of force (in Newtons, typically negative)
-
getMinTorqueLimit
public float getMinTorqueLimit()Return the minimum torque to apply in an angular constraint. Ignored in a linear motor. The settings are unaffected. (native attribute: mMinTorqueLimit)- Returns:
- the amount of torque (in Newton-meters, typically negative)
-
getSpringSettings
Access the settings for the spring used to drive to the position target. Ignored in a velocity motor. The motor settings are unaffected. (native attribute: mSpringSettings)- Returns:
- a new JVM object with the pre-existing native object assigned
-
isValid
public boolean isValid()Test whether the settings are valid. They are unaffected.- Returns:
- true if valid, otherwise false
-
setForceLimit
public void setForceLimit(float limit) Alter both force limits of a linear motor to be symmetrical.- Parameters:
limit- the desired limit (in Newtons)
-
setForceLimits
public void setForceLimits(float min, float max) Alter both force limits of a linear motor.- Parameters:
min- the desired lower limit (in Newtons, default=-MAX_FLOAT)max- the desired upper limit (in Newtons, default=MAX_FLOAT)
-
setMaxForceLimit
public void setMaxForceLimit(float force) Alter the maximum force to apply in a linear constraint. Ignored in an angular motor. (native attribute: mMaxForceLimit)- Parameters:
force- the desired amount of force (in Newtons, typically positive, default=MAX_VALUE)
-
setMaxTorqueLimit
public void setMaxTorqueLimit(float torque) Alter the maximum torque to apply in an angular constraint. Ignored in a linear motor. (native attribute: mMaxTorqueLimit)- Parameters:
torque- the desired amount of torque (in Newton-meters, typically positive, default=MAX_VALUE)
-
setMinForceLimit
public void setMinForceLimit(float force) Alter the minimum force to apply in a linear constraint. Ignored in an angular motor. (native attribute: mMinForceLimit)- Parameters:
force- the desired amount of force (in Newtons, typically negative, default=-MAX_VALUE)
-
setMinTorqueLimit
public void setMinTorqueLimit(float torque) Alter the minimum torque to apply in an angular constraint. Ignored in a linear motor. (native attribute: mMinTorqueLimit)- Parameters:
torque- the desired amount of torque (in Newton-meters, typically negative, default=-MAX_VALUE)
-
setTorqueLimit
public void setTorqueLimit(float limit) Alter both torque limits of an angular motor to be symmetrical.- Parameters:
limit- the desired upper limit (in Newton-meters)
-
setTorqueLimits
public void setTorqueLimits(float min, float max) Alter both torque limits of an angular motor.- Parameters:
min- the desired lower limit (in Newton-meters, default=-MAX_FLOAT)max- the desired upper limit (in Newton-meters, default=MAX_FLOAT)
-