Class Sphere

java.lang.Object
eu.iv4xr.framework.spatial.Sphere
All Implemented Interfaces:
LineIntersectable

public class Sphere extends Object implements LineIntersectable
Sphere with line intersections.
Author:
Naraenda
  • Field Details

    • EPSILON

      static float EPSILON
    • radius

      public float radius
    • center

      public Vec3 center
  • Constructor Details

    • Sphere

      public Sphere(float radius, Vec3 center)
  • Method Details

    • intersect

      public Collection<Vec3> intersect(Line l)
      Line-sphere intersection: https://en.wikipedia.org/wiki/Line%E2%80%93sphere_intersection
      Specified by:
      intersect in interface LineIntersectable
      Parameters:
      l - line segment
      Returns:
      list of intersections.