Record Class PointAttractorForceData

java.lang.Object
java.lang.Record
foundry.veil.api.quasar.data.module.force.PointAttractorForceData
All Implemented Interfaces:
ParticleModuleData

public record PointAttractorForceData(org.joml.Vector3dc position, boolean localPosition, float range, float strength, boolean strengthByDistance, boolean invertDistanceModifier) extends Record implements ParticleModuleData
A force that attracts particles to a point.

Point attractor forces are forces that are applied in the direction of a point. They are useful for simulating gravity or other forces that pull particles towards a point. The strength of the force is determined by the strength parameter. The falloff parameter determines how quickly the force falls off with distance. (unused) The strengthByDistance parameter determines whether the strength of the force is multiplied by the distance from the point. If strengthByDistance is true, the strength of the force is multiplied by (1 - distance / range). If strengthByDistance is false, the strength of the force is not affected by distance. The range parameter determines the maximum distance from the point at which the force is applied. If the distance from the point is greater than the range, the force is not applied. The position parameter determines the position of the point. The position parameter can be a Vec3 or a Supplier Vec3. If the position parameter is a Vec3, the position of the point is fixed. If the position parameter is a Supplier Vec3, the position of the point is updated every tick. This allows the point to move.

  • Field Details

  • Constructor Details

    • PointAttractorForceData

      public PointAttractorForceData(org.joml.Vector3dc position, boolean localPosition, float range, float strength, boolean strengthByDistance, boolean invertDistanceModifier)
      Creates an instance of a PointAttractorForceData record class.
      Parameters:
      position - the value for the position record component
      localPosition - the value for the localPosition record component
      range - the value for the range record component
      strength - the value for the strength record component
      strengthByDistance - the value for the strengthByDistance record component
      invertDistanceModifier - the value for the invertDistanceModifier record component
  • Method Details

    • addModules

      public void addModules(ParticleModuleSet.Builder builder)
      Specified by:
      addModules in interface ParticleModuleData
    • getType

      public ModuleType<?> getType()
      Specified by:
      getType in interface ParticleModuleData
    • 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.
    • position

      public org.joml.Vector3dc position()
      Returns the value of the position record component.
      Returns:
      the value of the position record component
    • localPosition

      public boolean localPosition()
      Returns the value of the localPosition record component.
      Returns:
      the value of the localPosition record component
    • range

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

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

      public boolean strengthByDistance()
      Returns the value of the strengthByDistance record component.
      Returns:
      the value of the strengthByDistance record component
    • invertDistanceModifier

      public boolean invertDistanceModifier()
      Returns the value of the invertDistanceModifier record component.
      Returns:
      the value of the invertDistanceModifier record component