Interface Ray2DType

  • All Known Implementing Classes:
    Ray2D

    @Immutable
    public interface Ray2DType
    Immutable two-dimensional ray type, defined as an origin and a direction vector.
    Since:
    3.0.0
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      com.io7m.jtensors.core.unparameterized.vectors.Vector2D direction()  
      default com.io7m.jtensors.core.unparameterized.vectors.Vector2D directionInverse()  
      default boolean intersectsArea​(double x0, double y0, double x1, double y1)
      Branchless optimization of the Kay-Kajiya slab ray/AABB intersection test by Tavian Barnes.
      com.io7m.jtensors.core.unparameterized.vectors.Vector2D origin()  
    • Method Detail

      • origin

        @Parameter
        com.io7m.jtensors.core.unparameterized.vectors.Vector2D origin()
        Returns:
        The origin point of this ray
      • direction

        @Parameter
        com.io7m.jtensors.core.unparameterized.vectors.Vector2D direction()
        Returns:
        The direction of this ray
      • directionInverse

        @Derived
        @Auxiliary
        default com.io7m.jtensors.core.unparameterized.vectors.Vector2D directionInverse()
        Returns:
        The inverted direction of this ray
      • intersectsArea

        default boolean intersectsArea​(double x0,
                                       double y0,
                                       double x1,
                                       double y1)

        Branchless optimization of the Kay-Kajiya slab ray/AABB intersection test by Tavian Barnes.

        See tavianator.com .

        Parameters:
        x0 - The lower X coordinate.
        x1 - The upper X coordinate.
        y0 - The lower Y coordinate.
        y1 - The upper Y coordinate.
        Returns:
        true if the ray is intersecting the box.