Class ShapeCastResult

All Implemented Interfaces:
ConstCollideShapeResult, ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>

public class ShapeCastResult extends CollideShapeResult
Information about a narrow-phase ray cast hitting a shape.
  • 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, otherwise false