Class SphereShape

java.lang.Object
me.deecaad.core.utils.shape.SphereShape
All Implemented Interfaces:
Shape

public final class SphereShape extends Object implements Shape
A sphere centered at the emitter origin. When hollow is true, samples lie on the surface; otherwise they fill the volume. Sampling is random; t is ignored. The emission direction is the radial outward normal.
  • Constructor Details

    • SphereShape

      public SphereShape(double radius, boolean hollow)
    • SphereShape

      public SphereShape(double radius)
  • Method Details

    • getRadius

      public double getRadius()
    • isHollow

      public boolean isHollow()
    • getPoint

      @NotNull public @NotNull ShapePoint getPoint(double t)
      Description copied from interface: Shape
      Returns one sample from this shape. For random shapes (sphere, cone, cube) t is ignored; for deterministic shapes (point, line, circle) t parameterizes the sample.
      Specified by:
      getPoint in interface Shape
      Parameters:
      t - Normalized parameter in [0, 1).
      Returns:
      The non-null shape point.