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.floatReturn the penetration depth: the distance to move body 2 out of collision.intReturn the ID of the first sub-shape that formed the manifold.intReturn 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, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, 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
-
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:
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
public int getSubShapeId1()Return the ID of the first sub-shape that formed the manifold. The manifold is unaffected. (native attribute: mSubShapeID1)- Specified by:
getSubShapeId1in interfaceConstContactManifold- Returns:
- a
SubShapeIDvalue (typically negative)
-
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:
getSubShapeId2in interfaceConstContactManifold- Returns:
- a
SubShapeIDvalue (typically negative)
-
getWorldSpaceNormal
Copy the normal vector: 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)
-