Interface DistanceScalingFunction

All Known Implementing Classes:
ConstantScalingFunction, ExponentialScalingFunction, LinearScalingFunction, LogarithmicScalingFunction, PolynomialScalingFunction, SigmoidScalingFunction

public interface DistanceScalingFunction
Contract for a mathematical falloff function that maps a spatial distance from a topological origin or axis to a normalized effect intensity scalar.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    apply(float distance, float maxRadius)
    Evaluates the distance scaling function at the given distance relative to maxRadius.
    com.mojang.serialization.MapCodec<? extends DistanceScalingFunction>
    Retrieves the MapCodec responsible for serializing and deserializing this function type.
  • Method Details

    • apply

      float apply(float distance, float maxRadius)
      Evaluates the distance scaling function at the given distance relative to maxRadius.
      Parameters:
      distance - The measured distance from the spatial origin or reference axis.
      maxRadius - The maximum operational radius of the topological component.
      Returns:
      The calculated intensity multiplier scalar (typically bounded in $[0.0, 1.0]$).
    • codec

      com.mojang.serialization.MapCodec<? extends DistanceScalingFunction> codec()
      Retrieves the MapCodec responsible for serializing and deserializing this function type.
      Returns:
      The registered MapCodec instance.