Package com.github.stephengold.joltjni
Class CollideShapeResult
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.CollideShapeResult
- All Implemented Interfaces:
ConstCollideShapeResult,ConstJoltPhysicsObject,AutoCloseable,Comparable<ConstJoltPhysicsObject>
- Direct Known Subclasses:
ShapeCastResult
Information about a narrow-phase collision by a shape.
-
Constructor Summary
ConstructorsConstructorDescriptionCollideShapeResult(long shapeResultVa) Instantiate a shape result with the specified native object assigned but not owned. -
Method Summary
Modifier and TypeMethodDescriptionIdentify the body to which shape 2 belongs.Copy the contact location on the surface of shape 1.Copy the contact location on the surface of shape 2.Copy the direction to move shape 2 out of collision along the shortest path.floatReturn the distance to move shape 2 to resolve the collision.Identify the face on shape 1 where the collision occurred.Identify the subshape on shape 2 where the collision occurred.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
-
CollideShapeResult
public CollideShapeResult(long shapeResultVa) Instantiate a shape result with the specified native object assigned but not owned.For use in custom collectors.
- Parameters:
shapeResultVa- the virtual address of the native object to assign (not zero)
-
-
Method Details
-
getBodyId2
Identify the body to which shape 2 belongs. The result object is unaffected. (native attribute: mBodyID2)- Specified by:
getBodyId2in interfaceConstCollideShapeResult- Returns:
- a new JVM object with a new native object assigned
-
getContactPointOn1
Copy the contact location on the surface of shape 1. The object is unaffected. (native attribute: mContactPointOn1)- Specified by:
getContactPointOn1in interfaceConstCollideShapeResult- Returns:
- a new location vector
-
getContactPointOn2
Copy the contact location on the surface of shape 2. The object is unaffected. (native attribute: mContactPointOn2)- Specified by:
getContactPointOn2in interfaceConstCollideShapeResult- Returns:
- a new location vector
-
getPenetrationAxis
Copy the direction to move shape 2 out of collision along the shortest path. The object is unaffected. (native attribute: mPenetrationAxis)- Specified by:
getPenetrationAxisin interfaceConstCollideShapeResult- Returns:
- a new direction vector in system coordinates
-
getPenetrationDepth
public float getPenetrationDepth()Return the distance to move shape 2 to resolve the collision. The object is unaffected. (native attribute: mPenetrationDepth)- Specified by:
getPenetrationDepthin interfaceConstCollideShapeResult- Returns:
- the signed distance
-
getSubShapeId1
Identify the face on shape 1 where the collision occurred. The object is unaffected. (native attribute: mSubShapeID1)- Specified by:
getSubShapeId1in interfaceConstCollideShapeResult- Returns:
- a new ID
-
getSubShapeId2
Identify the subshape on shape 2 where the collision occurred. The object is unaffected. (native attribute: mSubShapeID2)- Specified by:
getSubShapeId2in interfaceConstCollideShapeResult- Returns:
- a new JVM object with a new native object assigned
-