Record Class VectorField
java.lang.Object
java.lang.Record
foundry.veil.api.quasar.emitters.module.update.VectorField
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
-
Constructor Summary
ConstructorDescriptionVectorField
(FastNoiseLite noise, float strength) Creates an instance of aVectorField
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal 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
hashCode()
Returns a hash code value for this object.noise()
Returns the value of thenoise
record component.float
strength()
Returns the value of thestrength
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
VectorField
Creates an instance of aVectorField
record class.- Parameters:
noise
- the value for thenoise
record componentstrength
- the value for thestrength
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
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. -
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. -
equals
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 withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
noise
Returns the value of thenoise
record component.- Returns:
- the value of the
noise
record component
-
strength
public float strength()Returns the value of thestrength
record component.- Returns:
- the value of the
strength
record component
-