Package com.github.stephengold.joltjni
Class HingeConstraintSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.SerializableObject
com.github.stephengold.joltjni.ConstraintSettings
com.github.stephengold.joltjni.TwoBodyConstraintSettings
com.github.stephengold.joltjni.HingeConstraintSettings
- All Implemented Interfaces:
ConstConstraintSettings
,ConstJoltPhysicsObject
,RefTarget
,AutoCloseable
,Comparable<JoltPhysicsObject>
Settings used to construct a
HingeConstraint
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCopy the hinge axis of body 1.Copy the hinge axis of body 2.float
Return the upper limit of rotation.float
Return the lower limit of rotation.Access the spring settings.float
Return the maximum friction torque when not driven by a motor.Access the motor settings.Copy the normal axis of body 1.Copy the normal axis of body 2.Copy the constraint location for body 1.Copy the constraint location for body 2.getSpace()
Return which space the other properties are specified in.setHingeAxis1
(Vec3Arg direction) Alter the hinge axis of body 1.setHingeAxis2
(Vec3Arg direction) Alter the hinge axis of body 2.void
setLimitsMax
(float limit) Alter the upper limit of rotation.void
setLimitsMin
(float limit) Alter the lower limit of rotation.void
setMaxFrictionTorque
(float torque) Alter the maximum friction torque when not driven by a motor.void
setMotorSettings
(MotorSettings settings) Alter the constraint's motor settings.setNormalAxis1
(Vec3Arg direction) Alter the normal axis of body 1.setNormalAxis2
(Vec3Arg direction) Alter the normal axis of body 2.Alter the constraint location for body 1.Alter the constraint location for body 2.void
setSpace
(EConstraintSpace space) Alter which space the other properties are specified in.Methods inherited from class com.github.stephengold.joltjni.TwoBodyConstraintSettings
create, toRef
Methods inherited from class com.github.stephengold.joltjni.ConstraintSettings
getConstraintPriority, getControllerType, getDrawConstraintSize, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, getRefCount, setConstraintPriority, setDrawConstraintSize, setEmbedded, setEnabled, setNumPositionStepsOverride, setNumVelocityStepsOverride
Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Constructor Details
-
HingeConstraintSettings
public HingeConstraintSettings()Instantiate default settings.
-
-
Method Details
-
getHingeAxis1
Copy the hinge axis of body 1. The settings are unaffected. (native attribute: mHingeAxis1)- Returns:
- a new direction vector
-
getHingeAxis2
Copy the hinge axis of body 2. The settings are unaffected. (native attribute: mHingeAxis2)- Returns:
- a new direction vector
-
getLimitsMax
public float getLimitsMax()Return the upper limit of rotation. The settings are unaffected. (native attribute: mLimitsMax)- Returns:
- the upper limit (in radians)
-
getLimitsMin
public float getLimitsMin()Return the lower limit of rotation. The settings are unaffected. (native attribute: mLimitsMin)- Returns:
- the lower limit (in radians)
-
getLimitsSpringSettings
Access the spring settings. (native attribute: mLimitsSpringSettings)- Returns:
- a new JVM object with the pre-existing native object assigned
-
getMaxFrictionTorque
public float getMaxFrictionTorque()Return the maximum friction torque when not driven by a motor. The settings are unaffected. (native attribute: mMaxFrictionTorque)- Returns:
- the torque (in Newton.meters)
-
getMotorSettings
Access the motor settings. (native attribute: mMotorSettings)- Returns:
- a new JVM object with the pre-existing native object assigned
-
getNormalAxis1
Copy the normal axis of body 1. The settings are unaffected. (native attribute: mNormalAxis1)- Returns:
- a new direction vector
-
getNormalAxis2
Copy the normal axis of body 2. The settings are unaffected. (native attribute: mNormalAxis2)- Returns:
- a new direction vector
-
getPoint1
Copy the constraint location for body 1. The settings are unaffected. (native attribute: mPoint1)- Returns:
- a new location vector
-
getPoint2
Copy the constraint location for body 2. The settings are unaffected. (native attribute: mPoint2)- Returns:
- a new location vector
-
getSpace
Return which space the other properties are specified in. The settings are unaffected. (native attribute: mSpace)- Returns:
- an enum value (not null)
-
setHingeAxis1
Alter the hinge axis of body 1. (native attribute: mHingeAxis1)- Parameters:
direction
- the desired axis direction (not null, unaffected, default=(0,1,0))- Returns:
- the argument, for chaining
-
setHingeAxis2
Alter the hinge axis of body 2. (native attribute: mHingeAxis2)- Parameters:
direction
- the desired axis direction (not null, unaffected, default=(0,1,0))- Returns:
- the argument, for chaining
-
setLimitsMax
public void setLimitsMax(float limit) Alter the upper limit of rotation. (native attribute: mLimitsMax)- Parameters:
limit
- the desired upper limit (in radians, default=Pi)
-
setLimitsMin
public void setLimitsMin(float limit) Alter the lower limit of rotation. (native attribute: mLimitsMin)- Parameters:
limit
- the desired lower limit (default=-Pi)
-
setMaxFrictionTorque
public void setMaxFrictionTorque(float torque) Alter the maximum friction torque when not driven by a motor. (native attribute: mMaxFrictionTorque)- Parameters:
torque
- the desired torque (in Newton.meters, default=0)
-
setMotorSettings
Alter the constraint's motor settings. (native attribute: mMotorSettings)- Parameters:
settings
- the motor settings to copy (not null, unaffected)
-
setNormalAxis1
Alter the normal axis of body 1. (native attribute: mNormalAxis1)- Parameters:
direction
- the desired axis direction (not null, unaffected, default=(0,1,0))- Returns:
- the argument, for chaining
-
setNormalAxis2
Alter the normal axis of body 2. (native attribute: mNormalAxis2)- Parameters:
direction
- the desired axis direction (not null, unaffected, default=(0,1,0))- Returns:
- the argument, for chaining
-
setPoint1
Alter the constraint location for body 1. (native attribute: mPoint1)- Parameters:
location
- the desired location (not null, unaffected, default=(0,0,0))- Returns:
- the argument, for chaining
-
setPoint2
Alter the constraint location for body 2. (native attribute: mPoint2)- Parameters:
location
- the desired location (not null, unaffected, default=(0,0,0))- Returns:
- the argument, for chaining
-
setSpace
Alter which space the other properties are specified in. (native attribute: mSpace)- Parameters:
space
- enum value (not null, default=WorldSpace)
-