Interface Ray3d

All Known Subinterfaces:
MRay3d

public interface Ray3d
Read-only interface to handle 3-dimensional rays.
Since:
9.10.2
  • Method Summary

    Modifier and Type
    Method
    Description
    static Ray3d
    create(Vector3d origin, Vector3d direction)
    Returns a ray with the given origin and direction.
    static Ray3d
    create(Ray3d other)
    Returns a deep copy of the given ray.
    Returns the direction of this ray.
    Returns the origin of this ray.
    Returns an optional containing the intersection point between the ray and the triangle if present, an empty optional otherwise.
    boolean
    Returns true if the ray intersects with the box, false otherwise.
    boolean
    Returns true if the ray intersects with the triangle, false otherwise.
  • Method Details

    • create

      static Ray3d create(Ray3d other)
      Returns a deep copy of the given ray.
      Parameters:
      other - the other ray
      Returns:
      a deep copy of the given ray
      Since:
      9.10.2
    • create

      static Ray3d create(Vector3d origin, Vector3d direction)
      Returns a ray with the given origin and direction.
      Parameters:
      origin - the origin of the ray
      direction - the direction of the ray
      Returns:
      a ray with the given origin and direction
      Since:
      9.10.2
    • getOrigin

      Vector3d getOrigin()
      Returns the origin of this ray.
      Returns:
      the origin of this ray
      Since:
      9.10.2
    • getDirection

      Vector3d getDirection()
      Returns the direction of this ray.
      Returns:
      the direction of this ray
      Since:
      9.10.2
    • intersects

      boolean intersects(AABB3d aabb)
      Returns true if the ray intersects with the box, false otherwise.
      Parameters:
      aabb - the axis-aligned bounding box
      Returns:
      true if the ray intersects with the box, false otherwise
      Since:
      9.10.2
    • intersects

      boolean intersects(Triangle3d triangle)
      Returns true if the ray intersects with the triangle, false otherwise.
      Parameters:
      triangle - the triangle
      Returns:
      true if the ray intersects with the triangle, false otherwise
      Since:
      9.10.2
    • intersect

      Optional<MVector3d> intersect(Triangle3d triangle)
      Returns an optional containing the intersection point between the ray and the triangle if present, an empty optional otherwise.
      Parameters:
      triangle - the triangle
      Returns:
      an optional containing the intersection point between the ray and the triangle if present, an empty optional otherwise