Package com.github.stephengold.joltjni
Class HingeConstraintSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
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,ConstSerializableObject,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
Settings used to construct a
HingeConstraint.-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate default settings.Instantiate a copy of the specified settings. -
Method Summary
Modifier and TypeMethodDescriptionCopy the hinge axis of body 1.voidgetHingeAxis1(Vec3 storeResult) Copy the hinge axis of body 1.Copy the hinge axis of body 2.voidgetHingeAxis2(Vec3 storeResult) Copy the hinge axis of body 2.floatReturn the upper limit of rotation.floatReturn the lower limit of rotation.Access the spring settings.floatReturn the maximum friction torque when not driven by a motor.Access the motor settings.Copy the normal axis of body 1.voidgetNormalAxis1(Vec3 storeResult) Copy the normal axis of body 1.Copy the normal axis of body 2.voidgetNormalAxis2(Vec3 storeResult) Copy the normal axis of body 2.Copy the constraint location for body 1.voidCopy the constraint location for body 1.Copy the constraint location for body 2.voidCopy the constraint location for body 2.getSpace()Return which space the other properties are specified in.voidset(HingeConstraintSettings source) Copy the argument to the current settings.voidsetHingeAxis1(float x, float y, float z) Alter the hinge axis of body 1.setHingeAxis1(Vec3Arg direction) Alter the hinge axis of body 1.voidsetHingeAxis2(float x, float y, float z) Alter the hinge axis of body 2.setHingeAxis2(Vec3Arg direction) Alter the hinge axis of body 2.voidsetLimitsMax(float limit) Alter the upper limit of rotation.voidsetLimitsMin(float limit) Alter the lower limit of rotation.voidsetMaxFrictionTorque(float torque) Alter the maximum friction torque when not driven by a motor.voidsetMotorSettings(MotorSettings settings) Alter the constraint's motor settings.voidsetNormalAxis1(float x, float y, float z) Alter the normal axis of body 1.setNormalAxis1(Vec3Arg direction) Alter the normal axis of body 1.voidsetNormalAxis2(float x, float y, float z) Alter the normal axis of body 2.setNormalAxis2(Vec3Arg direction) Alter the normal axis of body 2.voidsetPoint1(double x, double y, double z) Alter the constraint location for body 1.Alter the constraint location for body 1.voidsetPoint2(double x, double y, double z) Alter the constraint location for body 2.Alter the constraint location for body 2.voidsetSpace(EConstraintSpace space) Alter which space the other properties are specified in.Methods inherited from class com.github.stephengold.joltjni.TwoBodyConstraintSettings
create, toRefMethods inherited from class com.github.stephengold.joltjni.ConstraintSettings
getConstraintPriority, getControllerType, getDrawConstraintSize, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, getRefCount, saveBinaryState, setConstraintPriority, setDrawConstraintSize, setEmbedded, setEnabled, setNumPositionStepsOverride, setNumVelocityStepsOverride, setVirtualAddressAsCoOwner, sRestoreFromBinaryStateMethods inherited from class com.github.stephengold.joltjni.SerializableObject
getRttiMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, targetVaOrZero, toString, vaMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa, targetVaOrZeroMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstSerializableObject
getRtti
-
Constructor Details
-
HingeConstraintSettings
public HingeConstraintSettings()Instantiate default settings. -
HingeConstraintSettings
Instantiate a copy of the specified settings.- Parameters:
original- the settings to copy (notnull, unaffected)
-
-
Method Details
-
getHingeAxis1
Copy the hinge axis of body 1. The settings are unaffected. (native attribute: mHingeAxis1)- Returns:
- a new direction vector
-
getHingeAxis1
Copy the hinge axis of body 1. The settings are unaffected. (native attribute: mHingeAxis1)- Parameters:
storeResult- storage for the direction (notnull, modified)
-
getHingeAxis2
Copy the hinge axis of body 2. The settings are unaffected. (native attribute: mHingeAxis2)- Returns:
- a new direction vector
-
getHingeAxis2
Copy the hinge axis of body 2. The settings are unaffected. (native attribute: mHingeAxis2)- Parameters:
storeResult- storage for the direction (notnull, modified)
-
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
-
getNormalAxis1
Copy the normal axis of body 1. The settings are unaffected. (native attribute: mNormalAxis1)- Parameters:
storeResult- storage for the direction (notnull, modified)
-
getNormalAxis2
Copy the normal axis of body 2. The settings are unaffected. (native attribute: mNormalAxis2)- Returns:
- a new direction vector
-
getNormalAxis2
Copy the normal axis of body 2. The settings are unaffected. (native attribute: mNormalAxis2)- Parameters:
storeResult- storage for the direction (notnull, modified)
-
getPoint1
Copy the constraint location for body 1. The settings are unaffected. (native attribute: mPoint1)- Returns:
- a new location vector
-
getPoint1
Copy the constraint location for body 1. The settings are unaffected. (native attribute: mPoint1)- Parameters:
storeResult- storage for the location (notnull, modified)
-
getPoint2
Copy the constraint location for body 2. The settings are unaffected. (native attribute: mPoint2)- Returns:
- a new location vector
-
getPoint2
Copy the constraint location for body 2. The settings are unaffected. (native attribute: mPoint2)- Parameters:
storeResult- storage for the location (notnull, modified)
-
getSpace
Return which space the other properties are specified in. The settings are unaffected. (native attribute: mSpace)- Returns:
- an enum value (not
null)
-
set
Copy the argument to the current settings.- Parameters:
source- the settings to copy (notnull, unaffected)
-
setHingeAxis1
public void setHingeAxis1(float x, float y, float z) Alter the hinge axis of body 1. (native attribute: mHingeAxis1)- Parameters:
x- the desired X component of the axis direction (default=0)y- the desired Y component of the axis direction (default=1)z- the desired Z component of the axis direction (default=0)
-
setHingeAxis1
Alter the hinge axis of body 1. (native attribute: mHingeAxis1)- Parameters:
direction- the desired axis direction (notnull, unaffected, default=(0,1,0))- Returns:
- the argument, for chaining
-
setHingeAxis2
public void setHingeAxis2(float x, float y, float z) Alter the hinge axis of body 2. (native attribute: mHingeAxis2)- Parameters:
x- the desired X component of the axis direction (default=0)y- the desired Y component of the axis direction (default=1)z- the desired Z component of the axis direction (default=0)
-
setHingeAxis2
Alter the hinge axis of body 2. (native attribute: mHingeAxis2)- Parameters:
direction- the desired axis direction (notnull, 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 (notnull, unaffected)
-
setNormalAxis1
public void setNormalAxis1(float x, float y, float z) Alter the normal axis of body 1. (native attribute: mNormalAxis1)- Parameters:
x- the desired X component of the axis direction (default=0)y- the desired Y component of the axis direction (default=1)z- the desired Z component of the axis direction (default=0)
-
setNormalAxis1
Alter the normal axis of body 1. (native attribute: mNormalAxis1)- Parameters:
direction- the desired axis direction (notnull, unaffected, default=(0,1,0))- Returns:
- the argument, for chaining
-
setNormalAxis2
public void setNormalAxis2(float x, float y, float z) Alter the normal axis of body 2. (native attribute: mNormalAxis2)- Parameters:
x- the desired X component of the axis direction (default=0)y- the desired Y component of the axis direction (default=1)z- the desired Z component of the axis direction (default=0)
-
setNormalAxis2
Alter the normal axis of body 2. (native attribute: mNormalAxis2)- Parameters:
direction- the desired axis direction (notnull, unaffected, default=(0,1,0))- Returns:
- the argument, for chaining
-
setPoint1
public void setPoint1(double x, double y, double z) Alter the constraint location for body 1. (native attribute: mPoint1)- Parameters:
x- the desired X coordinate (default=0)y- the desired Y coordinate (default=0)z- the desired Z coordinate (default=0)
-
setPoint1
Alter the constraint location for body 1. (native attribute: mPoint1)- Parameters:
location- the desired location (notnull, unaffected, default=(0,0,0))- Returns:
- the argument, for chaining
-
setPoint2
public void setPoint2(double x, double y, double z) Alter the constraint location for body 2. (native attribute: mPoint2)- Parameters:
x- the desired X coordinate (default=0)y- the desired Y coordinate (default=0)z- the desired Z coordinate (default=0)
-
setPoint2
Alter the constraint location for body 2. (native attribute: mPoint2)- Parameters:
location- the desired location (notnull, 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 (notnull, default=WorldSpace)
-