Class LineShape

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

public final class LineShape extends Object implements Shape
A line segment from from to to, both expressed in emitter-local coordinates. t parameterizes position along the line. direction is the zero vector, so the emitter falls back to its own direction provider.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LineShape(double length)
    Convenience constructor: a line of length along the local +Z axis.
    LineShape(@NotNull org.bukkit.util.Vector from, @NotNull org.bukkit.util.Vector to)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull org.bukkit.util.Vector
     
    @NotNull ShapePoint
    getPoint(double t)
    Returns one sample from this shape.
    @NotNull org.bukkit.util.Vector
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface me.deecaad.core.utils.shape.Shape

    getPoints
  • Constructor Details

    • LineShape

      public LineShape(@NotNull @NotNull org.bukkit.util.Vector from, @NotNull @NotNull org.bukkit.util.Vector to)
    • LineShape

      public LineShape(double length)
      Convenience constructor: a line of length along the local +Z axis.
  • Method Details

    • getFrom

      @NotNull public @NotNull org.bukkit.util.Vector getFrom()
    • getTo

      @NotNull public @NotNull org.bukkit.util.Vector getTo()
    • 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.