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

public class BroadPhaseCastResult extends JoltPhysicsObject
Information about a broad-phase cast hit.
  • Constructor Details

    • BroadPhaseCastResult

      public BroadPhaseCastResult(JoltPhysicsObject container, long castResultVa)
      Instantiate with the specified container and native object.

      For use in custom collectors.

      Parameters:
      container - the containing object, or null if none
      castResultVa - 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

      public RayCastBodyCollector getCollector()
      Access the underlying RayCastBodyCollector.
      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)