Class RayCollision

java.lang.Object
com.raylib.RayCollision

public class RayCollision extends Object
RayCollision, ray hit information
  • Field Details

    • memorySegment

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

    • RayCollision

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

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

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

      public RayCollision(boolean hit, float distance, Vector3 point, Vector3 normal)
      Construct with auto memory allocator and fields initialized as specified
      Parameters:
      hit - Did the ray hit something?
      distance - Distance to the nearest hit
      point - Point of the nearest hit
      normal - Surface normal of hit
    • RayCollision

      public RayCollision(SegmentAllocator arena, boolean hit, float distance, Vector3 point, Vector3 normal)
      Construct with your own memory allocator and fields initialized as specified
      Parameters:
      hit - Did the ray hit something?
      distance - Distance to the nearest hit
      point - Point of the nearest hit
      normal - Surface normal of hit
  • 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 RayCollision getArrayElement(int index)
    • allocateArray

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

      public static RayCollision allocateArray(long elementCount)
      Allocate an array of RayCollision
    • getHit

      public boolean getHit()
      Did the ray hit something?
    • setHit

      public void setHit(boolean value)
      Did the ray hit something?
    • hit

      public boolean hit()
      Did the ray hit something?
    • hit

      public RayCollision hit(boolean value)
      Did the ray hit something?
    • getDistance

      public float getDistance()
      Distance to the nearest hit
    • setDistance

      public void setDistance(float value)
      Distance to the nearest hit
    • distance

      public float distance()
      Distance to the nearest hit
    • distance

      public RayCollision distance(float value)
      Distance to the nearest hit
    • getPoint

      public Vector3 getPoint()
      Point of the nearest hit
    • setPoint

      public void setPoint(Vector3 value)
      Point of the nearest hit
    • point

      public Vector3 point()
      Point of the nearest hit
    • point

      public RayCollision point(Vector3 value)
      Point of the nearest hit
    • getNormal

      public Vector3 getNormal()
      Surface normal of hit
    • setNormal

      public void setNormal(Vector3 value)
      Surface normal of hit
    • normal

      public Vector3 normal()
      Surface normal of hit
    • normal

      public RayCollision normal(Vector3 value)
      Surface normal of hit