Record Class WorldDistanceScaling

java.lang.Object
java.lang.Record
com.render.api.world.WorldDistanceScaling

public record WorldDistanceScaling(float baseScale, float referenceDistance, float minScale, float maxScale) extends Record
Distance-aware scale policy used by text, images, and waypoints.
  • Constructor Summary

    Constructors
    Constructor
    Description
    WorldDistanceScaling(float baseScale, float referenceDistance, float minScale, float maxScale)
    Creates an instance of a WorldDistanceScaling record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    Returns the value of the baseScale record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    fixed(float scale)
     
    final int
    Returns a hash code value for this object.
    float
    Returns the value of the maxScale record component.
    float
    Returns the value of the minScale record component.
    float
    Returns the value of the referenceDistance record component.
    float
    scale(double distance)
     
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • WorldDistanceScaling

      public WorldDistanceScaling(float baseScale, float referenceDistance, float minScale, float maxScale)
      Creates an instance of a WorldDistanceScaling record class.
      Parameters:
      baseScale - the value for the baseScale record component
      referenceDistance - the value for the referenceDistance record component
      minScale - the value for the minScale record component
      maxScale - the value for the maxScale record component
  • Method Details

    • fixed

      public static WorldDistanceScaling fixed(float scale)
    • scale

      public float scale(double distance)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • baseScale

      public float baseScale()
      Returns the value of the baseScale record component.
      Returns:
      the value of the baseScale record component
    • referenceDistance

      public float referenceDistance()
      Returns the value of the referenceDistance record component.
      Returns:
      the value of the referenceDistance record component
    • minScale

      public float minScale()
      Returns the value of the minScale record component.
      Returns:
      the value of the minScale record component
    • maxScale

      public float maxScale()
      Returns the value of the maxScale record component.
      Returns:
      the value of the maxScale record component