Package com.github.stephengold.joltjni
Class BroadPhaseCastResult
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.BroadPhaseCastResult
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<ConstJoltPhysicsObject>
- Direct Known Subclasses:
RayCastResult
Information about a broad-phase cast hit.
-
Constructor Summary
ConstructorsConstructorDescriptionBroadPhaseCastResult(RayCastBodyCollector collector, long castResultVa) Instantiate with the specified native object assigned but not owned. -
Method Summary
Modifier and TypeMethodDescriptionReturn the ID of the body that was hit.Access the underlyingRayCastBodyCollector.floatReturn the location of the hit, as a fraction of the cast path.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, va
-
Constructor Details
-
BroadPhaseCastResult
Instantiate with the specified native object assigned but not owned.For use in custom collectors.
- Parameters:
collector- the underlyingRayCastBodyCollector, ornull if nonecastResultVa- the virtual address of the native object to assign (not zero)
-
-
Method Details
-
getBodyId
Return the ID of the body that was hit. The result object is unaffected. (native attribute: mBodyID)- Returns:
- a new JVM object with the pre-existing native object assigned
-
getCollector
Access the underlyingRayCastBodyCollector.- Returns:
- the pre-existing instance
-
getFraction
public float getFraction()Return the location of the hit, as a fraction of the cast path. The result object is unaffected. (native attribute: mFraction)- Returns:
- the fraction (≥0)
-