Package com.github.stephengold.joltjni
Class ContactManifold
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.ContactManifold
- All Implemented Interfaces:
ConstContactManifold,ConstJoltPhysicsObject,AutoCloseable,Comparable<ConstJoltPhysicsObject>
The contact surface between two bodies.
-
Constructor Summary
ConstructorsConstructorDescriptionContactManifold(long pairVa) Instantiate a manifold with the specified native object assigned but not owned. -
Method Summary
Modifier and TypeMethodDescriptionReturn the location from which all contact points are measured.floatReturn the penetration depth: the distance to move body 2 out of collision.Return the ID of the first subshape that formed the manifold.Return the ID of the 2nd subshape that formed the manifold.Return the normal: the direction to move body 2 out of collision.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, 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, va
-
Constructor Details
-
ContactManifold
public ContactManifold(long pairVa) Instantiate a manifold with the specified native object assigned but not owned.- Parameters:
pairVa- the virtual address of the native object to assign (not zero)
-
-
Method Details
-
getBaseOffset
Return the location from which all contact points are measured. The manifold is unaffected. (native attribute: mBaseOffset)- Specified by:
getBaseOffsetin 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:
getPenetrationDepthin interfaceConstContactManifold- Returns:
- the signed distance (negative for a speculative contact)
-
getSubShapeId1
Return the ID of the first subshape that formed the manifold. The manifold is unaffected. (native attribute: mSubShapeID1)- Specified by:
getSubShapeId1in interfaceConstContactManifold- Returns:
- a new object
-
getSubShapeId2
Return the ID of the 2nd subshape that formed the manifold. The manifold is unaffected. (native attribute: mSubShapeID2)- Specified by:
getSubShapeId2in interfaceConstContactManifold- Returns:
- a new object
-
getWorldSpaceNormal
Return the normal: the direction to move body 2 out of collision. The manifold is unaffected. (native attribute: mWorldSpaceNormal)- Specified by:
getWorldSpaceNormalin interfaceConstContactManifold- Returns:
- a new direction vector (in system coordinates)
-