Package com.github.stephengold.joltjni
Class TwoBodyConstraint
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.Constraint
com.github.stephengold.joltjni.TwoBodyConstraint
- All Implemented Interfaces:
ConstConstraint,ConstJoltPhysicsObject,ConstTwoBodyConstraint,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
- Direct Known Subclasses:
ConeConstraint,DistanceConstraint,FixedConstraint,GearConstraint,HingeConstraint,PathConstraint,PointConstraint,PulleyConstraint,RackAndPinionConstraint,SixDofConstraint,SliderConstraint,SwingTwistConstraint
A type of
Constraint that joins 2 bodies.-
Method Summary
Modifier and TypeMethodDescriptiongetBody1()Access the first body in the constraint.voidgetBody1PivotLocation(DoubleBuffer storeResult) Copy the first body's pivot location.getBody2()Access the 2nd body in the constraint.voidgetBody2PivotLocation(DoubleBuffer storeResult) Copy the 2nd body's pivot location.Calculate the coordinate transform from constraint space to body 1.Calculate the coordinate transform from constraint space to body 2.toRef()Create a counted reference to the nativeTwoBodyConstraint.Methods inherited from class com.github.stephengold.joltjni.Constraint
getConstraintPriority, getConstraintSettings, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, getRefCount, getSubType, getType, isActive, notifyShapeChanged, restoreState, saveState, setConstraintPriority, setEmbedded, setEnabled, setNumPositionStepsOverride, setNumVelocityStepsOverride, setVirtualAddressAsCoOwnerMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, 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.ConstConstraint
getConstraintPriority, getConstraintSettings, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, getSubType, getType, isActive, saveStateMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Method Details
-
toRef
Create a counted reference to the nativeTwoBodyConstraint.- Specified by:
toRefin interfaceRefTarget- Overrides:
toRefin classConstraint- Returns:
- a new JVM object with a new native object assigned
-
getBody1
Access the first body in the constraint. The constraint is unaffected.- Specified by:
getBody1in interfaceConstTwoBodyConstraint- Returns:
- a new JVM object with the pre-existing native object assigned
-
getBody1PivotLocation
Copy the first body's pivot location. The constraint is unaffected.- Specified by:
getBody1PivotLocationin interfaceConstTwoBodyConstraint- Parameters:
storeResult- storage for the location in system coordinates (not null, modified)
-
getBody2
Access the 2nd body in the constraint. The constraint is unaffected.- Specified by:
getBody2in interfaceConstTwoBodyConstraint- Returns:
- a new JVM object with the pre-existing native object assigned
-
getBody2PivotLocation
Copy the 2nd body's pivot location. The constraint is unaffected.- Specified by:
getBody2PivotLocationin interfaceConstTwoBodyConstraint- Parameters:
storeResult- storage for the location in system coordinates (not null, modified)
-
getConstraintToBody1Matrix
Calculate the coordinate transform from constraint space to body 1. The constraint is unaffected.- Specified by:
getConstraintToBody1Matrixin interfaceConstTwoBodyConstraint- Returns:
- a new transform matrix
-
getConstraintToBody2Matrix
Calculate the coordinate transform from constraint space to body 2. The constraint is unaffected.- Specified by:
getConstraintToBody2Matrixin interfaceConstTwoBodyConstraint- Returns:
- a new transform matrix
-