java.lang.Object
foundry.veil.api.quasar.emitters.module.update.VectorField
All Implemented Interfaces:
EditorAttributeProvider

public final class VectorField extends Object implements EditorAttributeProvider
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 Details

    • CODEC

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

    • VectorField

      public VectorField(FastNoiseLite noise, float strength)
  • 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)
    • renderImGuiAttributes

      public void renderImGuiAttributes()
      Description copied from interface: EditorAttributeProvider
      Renders all ImGui attributes into the current editor panel.
      Specified by:
      renderImGuiAttributes in interface EditorAttributeProvider
    • noise

      public FastNoiseLite noise()
    • strength

      public float strength()