java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.CollideShapeResult
com.github.stephengold.joltjni.ShapeCastResult
- All Implemented Interfaces:
ConstCollideShapeResult
,ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
Information about a narrow-phase ray cast hitting a shape.
-
Constructor Summary
ConstructorsConstructorDescriptionShapeCastResult
(long castResultVa) Instantiate a cast result with the specified native object assigned but not owned. -
Method Summary
Modifier and TypeMethodDescriptionfloat
Return the fraction of the cast where the hit occurred.boolean
Test whether the shape was hit from its back side.Methods inherited from class com.github.stephengold.joltjni.CollideShapeResult
getBodyId2, getContactPointOn1, getContactPointOn2, getPenetrationAxis, getPenetrationDepth, getShape1Face, getShape2Face, getSubShapeId1, getSubShapeId2
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
-
ShapeCastResult
public ShapeCastResult(long castResultVa) Instantiate a cast result with the specified native object assigned but not owned.For use in custom collectors.
- Parameters:
castResultVa
- the virtual address of the native object to assign (not zero)
-
-
Method Details
-
getFraction
public float getFraction()Return the fraction of the cast where the hit occurred. The result object is unaffected. (native attribute: mFraction)- Returns:
- the fraction (≥0, ≤1, 0→start, 1→end)
-
getIsBackFaceHit
public boolean getIsBackFaceHit()Test whether the shape was hit from its back side. The result object is unaffected. (native attribute: mIsBackFaceHit)- Returns:
true
if hit from back side, otherwisefalse
-