Package com.github.stephengold.joltjni
Class CharacterContactKey
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.CharacterContactKey
- All Implemented Interfaces:
ConstCharacterContactKey,ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
- Direct Known Subclasses:
CharacterContact
Identify a contact between a virtual character and a body or another virtual
character. (native type:
CharacterContactKey)-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate a default key.CharacterContactKey(char idType, int bodyOrCharacterId, int subShapeId) Instantiate a key with the specified parameters.CharacterContactKey(CharacterContactKey original) Instantiate a copy of the specified key. -
Method Summary
Modifier and TypeMethodDescriptionintgetBodyB()Return the ID of the colliding body.intReturn the ID of the colliding character.intReturn the sub-shape ID of the colliding body.booleanisEqual(ConstCharacterContactKey other) Test for content equivalence with another key.booleanTest for content equivalence with another key.voidrestoreState(StateRecorder recorder) Restore the key from the specified recorder.voidsaveState(StateRecorder recorder) Save the key to the specified recorder.toString()Return a string representation of the properties object, which is unaffected.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, 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
-
Constructor Details
-
CharacterContactKey
public CharacterContactKey()Instantiate a default key. -
CharacterContactKey
public CharacterContactKey(char idType, int bodyOrCharacterId, int subShapeId) Instantiate a key with the specified parameters.- Parameters:
idType- "b" for body or "c" for characterbodyOrCharacterId- theBodyIDorCharacterIDof the other colliding objectsubShapeId- theSubShapeIDof the shape that is in contact
-
CharacterContactKey
Instantiate a copy of the specified key.- Parameters:
original- the settings to copy (notnull, unaffected)
-
-
Method Details
-
restoreState
Restore the key from the specified recorder.- Parameters:
recorder- the recorder to restore from (notnull)
-
getBodyB
public int getBodyB()Return the ID of the colliding body. The key is unaffected. (native attribute: mBodyB)- Specified by:
getBodyBin interfaceConstCharacterContactKey- Returns:
- the
BodyIDvalue
-
getCharacterIdB
public int getCharacterIdB()Return the ID of the colliding character. The key is unaffected. (native attribute: mCharacterIDB)- Specified by:
getCharacterIdBin interfaceConstCharacterContactKey- Returns:
- the
CharacterIDvalue
-
getSubShapeIdB
public int getSubShapeIdB()Return the sub-shape ID of the colliding body. The contact is unaffected. (native attribute: mSubShapeIDB)- Specified by:
getSubShapeIdBin interfaceConstCharacterContactKey- Returns:
- a
SubShapeIDvalue (typically negative)
-
isEqual
Test for content equivalence with another key. The key is unaffected. (native operator: binary==)- Specified by:
isEqualin interfaceConstCharacterContactKey- Parameters:
other- the key to compare with (notnull, unaffected)- Returns:
trueif equivalent, otherwisefalse
-
isNotEqual
Test for content equivalence with another key. The key is unaffected.(native operator: binary!=)- Specified by:
isNotEqualin interfaceConstCharacterContactKey- Parameters:
other- the key to compare with (notnull, unaffected)- Returns:
falseif equivalent, otherwisetrue
-
saveState
Save the key to the specified recorder. The key is unaffected.- Specified by:
saveStatein interfaceConstCharacterContactKey- Parameters:
recorder- the recorder to save to (notnull)
-
toString
Return a string representation of the properties object, which is unaffected.- Overrides:
toStringin classJoltPhysicsObject- Returns:
- the string representation (not
null, not empty)
-