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.void
getBody1PivotLocation
(DoubleBuffer storeResult) Copy the first body's pivot location.getBody2()
Access the 2nd body in the constraint.void
getBody2PivotLocation
(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, notifyShapeChanged, setConstraintPriority, 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.ConstConstraint
getConstraintPriority, getConstraintSettings, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, getSubType, getType
Methods 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:
toRef
in interfaceRefTarget
- Overrides:
toRef
in 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:
getBody1
in 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:
getBody1PivotLocation
in 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:
getBody2
in 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:
getBody2PivotLocation
in 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:
getConstraintToBody1Matrix
in interfaceConstTwoBodyConstraint
- Returns:
- a new transform matrix
-
getConstraintToBody2Matrix
Calculate the coordinate transform from constraint space to body 2. The constraint is unaffected.- Specified by:
getConstraintToBody2Matrix
in interfaceConstTwoBodyConstraint
- Returns:
- a new transform matrix
-