Class Ray

java.lang.Object
com.raylib.Ray

public class Ray extends Object
Ray, ray for raycasting
  • Field Details

    • memorySegment

      public final MemorySegment memorySegment
      The native FFI MemorySegment that holds the data this object wraps.
  • Constructor Details

    • Ray

      public Ray()
      Construct with auto memory allocator and fields initialized to zero.
    • Ray

      public Ray(SegmentAllocator arena)
      Construct with your owm memory allocator and fields not initialized
    • Ray

      public Ray(MemorySegment memorySegment)
      Construct by wrapping around an already allocated MemorySegment, perhaps from another object
    • Ray

      public Ray(Vector3 position, Vector3 direction)
      Construct with auto memory allocator and fields initialized as specified
      Parameters:
      position - Ray position (origin)
      direction - Ray direction (normalized)
    • Ray

      public Ray(SegmentAllocator arena, Vector3 position, Vector3 direction)
      Construct with your own memory allocator and fields initialized as specified
      Parameters:
      position - Ray position (origin)
      direction - Ray direction (normalized)
  • Method Details

    • equals

      public boolean equals(Object o)
      Equality is tested on basis of both wrapper objects must refer to same native memory location to be considered equal
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getArrayElement

      public Ray getArrayElement(int index)
    • allocateArray

      public static Ray allocateArray(long elementCount, SegmentAllocator allocator)
      Allocate an array of Ray
    • allocateArray

      public static Ray allocateArray(long elementCount)
      Allocate an array of Ray
    • getPosition

      public Vector3 getPosition()
      Ray position (origin)
    • setPosition

      public void setPosition(Vector3 value)
      Ray position (origin)
    • position

      public Vector3 position()
      Ray position (origin)
    • position

      public Ray position(Vector3 value)
      Ray position (origin)
    • getDirection

      public Vector3 getDirection()
      Ray direction (normalized)
    • setDirection

      public void setDirection(Vector3 value)
      Ray direction (normalized)
    • direction

      public Vector3 direction()
      Ray direction (normalized)
    • direction

      public Ray direction(Vector3 value)
      Ray direction (normalized)