Class ConeShape

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

public final class ConeShape extends Object implements Shape
A cone with apex at the emitter origin, axis along local +Z, half-angle halfAngleRadians and length. Samples are random uniform-solid-angle directions within the cone; the offset places each sample on the cone's "spread surface" at the chosen direction times length. The emission direction is the chosen unit direction (outward along the cone).
  • Constructor Details

    • ConeShape

      public ConeShape(double halfAngleRadians, double length)
      Parameters:
      halfAngleRadians - Half the cone's opening angle, in radians. 0 = pure +Z; π/2 = full hemisphere.
      length - Distance from the apex along the chosen direction at which the offset is placed.
  • Method Details

    • getHalfAngleRadians

      public double getHalfAngleRadians()
    • getLength

      public double getLength()
    • 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.