java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.ContactManifold
- All Implemented Interfaces:
ConstContactManifold
,ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
The contact surface between two bodies.
-
Constructor Summary
ConstructorsConstructorDescriptionContactManifold
(long manifoldVa) Instantiate a manifold with the specified native object assigned but not owned. -
Method Summary
Modifier and TypeMethodDescriptionCopy the location from which all contact points are measured.float
Return the penetration depth: the distance to move body 2 out of collision.int
Return the ID of the first sub-shape that formed the manifold.int
Return the ID of the 2nd sub-shape that formed the manifold.Copy the normal vector: the direction to move body 2 out of collision.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.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Constructor Details
-
ContactManifold
public ContactManifold(long manifoldVa) Instantiate a manifold with the specified native object assigned but not owned.- Parameters:
manifoldVa
- the virtual address of the native object to assign (not zero)
-
-
Method Details
-
getBaseOffset
Copy the location from which all contact points are measured. The manifold is unaffected. (native attribute: mBaseOffset)- Specified by:
getBaseOffset
in interfaceConstContactManifold
- Returns:
- a new location vector
-
getPenetrationDepth
public float getPenetrationDepth()Return the penetration depth: the distance to move body 2 out of collision. The manifold is unaffected. (native attribute: mPenetrationDepth)- Specified by:
getPenetrationDepth
in interfaceConstContactManifold
- Returns:
- the signed distance (negative for a speculative contact)
-
getSubShapeId1
public int getSubShapeId1()Return the ID of the first sub-shape that formed the manifold. The manifold is unaffected. (native attribute: mSubShapeID1)- Specified by:
getSubShapeId1
in interfaceConstContactManifold
- Returns:
- a
SubShapeID
value
-
getSubShapeId2
public int getSubShapeId2()Return the ID of the 2nd sub-shape that formed the manifold. The manifold is unaffected. (native attribute: mSubShapeID2)- Specified by:
getSubShapeId2
in interfaceConstContactManifold
- Returns:
- a
SubShapeID
value
-
getWorldSpaceNormal
Copy the normal vector: the direction to move body 2 out of collision. The manifold is unaffected. (native attribute: mWorldSpaceNormal)- Specified by:
getWorldSpaceNormal
in interfaceConstContactManifold
- Returns:
- a new direction vector (in system coordinates)
-