Package com.github.stephengold.joltjni
Class ConnectedConstraint
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.ConnectedConstraint
- All Implemented Interfaces:
ConstConnectedConstraint,ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
A constraint in a scene and which bodies it connects to. (native type:
PhysicsScene::ConnectedConstraint)-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate a default constraint.ConnectedConstraint(ConstConnectedConstraint original) Instantiate a copy of the specified box.ConnectedConstraint(TwoBodyConstraintSettings settings, int body1, int body2) Instantiate a constraint with the specified settings and bodies. -
Method Summary
Modifier and TypeMethodDescriptionintgetBody1()Return the index of the first body.intgetBody2()Return the index of the 2nd body.Access the constraint settings.set(ConstConnectedConstraint source) Copy the argument to the current constraint.setBody1(int body1) Alter the index of the first body.setBody2(int body2) Alter the index of the 2nd body.setSettings(TwoBodyConstraintSettings settings) Replace the constraint settings.Methods 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, targetVaOrZero
-
Constructor Details
-
ConnectedConstraint
public ConnectedConstraint()Instantiate a default constraint. -
ConnectedConstraint
Instantiate a copy of the specified box.- Parameters:
original- the box to copy (notnull, unaffected)
-
ConnectedConstraint
Instantiate a constraint with the specified settings and bodies.- Parameters:
settings- the desired constraint settings (notnull, unaffected)body1- the index of the desired first body (default=0)body2- the index of the desired 2nd body (default=0)
-
-
Method Details
-
set
Copy the argument to the current constraint.- Parameters:
source- the constraint to copy (notnull, unaffected)- Returns:
- the modified constraint, for chaining
-
setBody1
Alter the index of the first body. (native attribute: mBody1)- Parameters:
body1- the index of the desired first body (default=0)- Returns:
- the modified constraint, for chaining
-
setBody2
Alter the index of the 2nd body. (native attribute: mBody2)- Parameters:
body2- the index of the desired 2nd body (default=0)- Returns:
- the modified constraint, for chaining
-
setSettings
Replace the constraint settings. (native attribute: mSettings)- Parameters:
settings- the desired settings (notnull, unaffected, default=null)- Returns:
- the modified constraint, for chaining
-
getBody1
public int getBody1()Return the index of the first body. (native attribute: mBody1)- Specified by:
getBody1in interfaceConstConnectedConstraint- Returns:
- the index of the first body
-
getBody2
public int getBody2()Return the index of the 2nd body. (native attribute: mBody2)- Specified by:
getBody2in interfaceConstConnectedConstraint- Returns:
- the index of the 2nd body
-
getSettings
Access the constraint settings. (native attribute: mSettings)- Specified by:
getSettingsin interfaceConstConnectedConstraint- Returns:
- a new JVM object with the pre-existing native object assigned
-