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 TypeMethodDescriptionfloatapply(float distance, float maxRadius) Evaluates the distance scaling function at the given distance relative tomaxRadius.com.mojang.serialization.MapCodec<? extends DistanceScalingFunction> codec()Retrieves theMapCodecresponsible 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 tomaxRadius.- 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 theMapCodecresponsible for serializing and deserializing this function type.- Returns:
- The registered
MapCodecinstance.
-