Record Class VectorField

java.lang.Object
java.lang.Record
foundry.veil.api.quasar.emitters.module.update.VectorField

public record VectorField(FastNoiseLite noise, float strength) extends Record
A 3D vector field implementation. This is used to apply a force to a particle based on its position.

The vector field is defined by a noise function, a strength, and a vector function. The noise function is used to generate a noise value at a given position. The strength is used to scale the noise value. The vector function is used to generate a vector if a custom vector field is desired. If no vector function is provided, a default one is used that generates a vector based on the noise value.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static com.mojang.serialization.Codec<VectorField>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    VectorField(FastNoiseLite noise, float strength)
    Creates an instance of a VectorField record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    org.joml.Vector3d
    getVector(org.joml.Vector3dc position)
     
    org.joml.Vector3d
    getVector(org.joml.Vector3dc position, org.joml.Vector3d result)
     
    final int
    Returns a hash code value for this object.
    Returns the value of the noise record component.
    float
    Returns the value of the strength record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • CODEC

      public static com.mojang.serialization.Codec<VectorField> CODEC
  • Constructor Details

    • VectorField

      public VectorField(FastNoiseLite noise, float strength)
      Creates an instance of a VectorField record class.
      Parameters:
      noise - the value for the noise record component
      strength - the value for the strength record component
  • Method Details

    • getVector

      public org.joml.Vector3d getVector(org.joml.Vector3dc position, org.joml.Vector3d result)
    • getVector

      public org.joml.Vector3d getVector(org.joml.Vector3dc position)
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • noise

      public FastNoiseLite noise()
      Returns the value of the noise record component.
      Returns:
      the value of the noise record component
    • strength

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