Enum Class DistanceCalculationMode

java.lang.Object
java.lang.Enum<DistanceCalculationMode>
com.hypixel.hytale.procedurallib.logic.cell.DistanceCalculationMode
All Implemented Interfaces:
Serializable, Comparable<DistanceCalculationMode>, Constable

public enum DistanceCalculationMode extends Enum<DistanceCalculationMode>
Since:
29.06.2017
See Also:
  • Enum Constant Details

    • EUCLIDEAN

      public static final DistanceCalculationMode EUCLIDEAN
      Euclidean distance produces single straight edges per side of the cell and perfect circles around the points. distance = dx * dx + dy * dy + dz * dz
    • MANHATTAN

      public static final DistanceCalculationMode MANHATTAN
      Manhattan distance only produces diagonal, horizontal and vertical edges. For distance noise it produces diamond shaped gradients. distance = |dx| + |dy| + |dz|
    • NATURAL

      public static final DistanceCalculationMode NATURAL
      Natural noise produces a little bit randomized edges which work perfectly for natural borders. distance = |dx| + |dy| + |dz| + dx * dx + dy * dy + dz * dz
    • MAX

      public static final DistanceCalculationMode MAX
      Addition of max metric space. This results in many jagged edges. distance = max(|dx|, |dy|, |dz|)
  • Method Details

    • values

      public static DistanceCalculationMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DistanceCalculationMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getFunction

      public PointDistanceFunction getFunction()
    • from

      @Nullable public static DistanceCalculationMode from(PointDistanceFunction function)