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<JoltPhysicsObject>
- Direct Known Subclasses:
RayCastResult
Information about a broad-phase cast hit.
-
Constructor Summary
ConstructorsConstructorDescriptionBroadPhaseCastResult
(JoltPhysicsObject container, long castResultVa) Instantiate with the specified container and native object. -
Method Summary
Modifier and TypeMethodDescriptionint
Return the ID of the body that was hit.Access the underlyingRayCastBodyCollector
.float
Return the location of the hit, as a fraction of the cast path.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Constructor Details
-
BroadPhaseCastResult
Instantiate with the specified container and native object.For use in custom collectors.
- Parameters:
container
- the containing object, ornull
if nonecastResultVa
- the virtual address of the native object to assign (not zero)
-
-
Method Details
-
getBodyId
public int getBodyId()Return the ID of the body that was hit. The result object is unaffected. (native attribute: mBodyID)- Returns:
- the
BodyID
value
-
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)
-