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

public class RRayCast extends JoltPhysicsObject
A ray cast with an RVec3 start location.
  • Constructor Details

    • RRayCast

      public RRayCast(RVec3Arg startLocation, Vec3Arg offset)
      Instantiate a ray cast with the specified endpoints.
      Parameters:
      startLocation - the desired start location (not null, unaffected)
      offset - the desired end offset from the start (not null, unaffected)
  • Method Details

    • getDirection

      public Vec3 getDirection()
      Copy the end offset. The ray cast is unaffected. (native attribute: mDirection)
      Returns:
      a new offset vector (relative to the start location)
    • getOrigin

      public RVec3 getOrigin()
      Copy the start location. The ray cast is unaffected. (native attribute: mOrigin)
      Returns:
      a new location vector
    • getPointOnRay

      public RVec3 getPointOnRay(float fraction)
      Return a point on the ray with the specified fraction. The ray cast is unaffected.
      Parameters:
      fraction - (0→start of ray, 1→end of ray)
      Returns:
      a new location vector