Record Class PointAttractorForceData
- All Implemented Interfaces:
ParticleModuleData
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<PointAttractorForceData> Fields inherited from interface foundry.veil.api.quasar.data.module.ParticleModuleData
INIT_CODEC, INIT_DIRECT_CODEC, RENDER_CODEC, RENDER_DIRECT_CODEC, UPDATE_CODEC, UPDATE_DIRECT_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionPointAttractorForceData(org.joml.Vector3dc position, boolean localPosition, float range, float strength, boolean strengthByDistance, boolean invertDistanceModifier) Creates an instance of aPointAttractorForceDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddModules(ParticleModuleSet.Builder builder) final booleanIndicates whether some other object is "equal to" this one.ModuleType<?> getType()final inthashCode()Returns a hash code value for this object.booleanReturns the value of theinvertDistanceModifierrecord component.booleanReturns the value of thelocalPositionrecord component.org.joml.Vector3dcposition()Returns the value of thepositionrecord component.floatrange()Returns the value of therangerecord component.floatstrength()Returns the value of thestrengthrecord component.booleanReturns the value of thestrengthByDistancerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
PointAttractorForceData
public PointAttractorForceData(org.joml.Vector3dc position, boolean localPosition, float range, float strength, boolean strengthByDistance, boolean invertDistanceModifier) Creates an instance of aPointAttractorForceDatarecord class.- Parameters:
position- the value for thepositionrecord componentlocalPosition- the value for thelocalPositionrecord componentrange- the value for therangerecord componentstrength- the value for thestrengthrecord componentstrengthByDistance- the value for thestrengthByDistancerecord componentinvertDistanceModifier- the value for theinvertDistanceModifierrecord component
-
-
Method Details
-
addModules
- Specified by:
addModulesin interfaceParticleModuleData
-
getType
- Specified by:
getTypein interfaceParticleModuleData
-
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 '=='. -
position
public org.joml.Vector3dc position()Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-
localPosition
public boolean localPosition()Returns the value of thelocalPositionrecord component.- Returns:
- the value of the
localPositionrecord component
-
range
public float range()Returns the value of therangerecord component.- Returns:
- the value of the
rangerecord component
-
strength
public float strength()Returns the value of thestrengthrecord component.- Returns:
- the value of the
strengthrecord component
-
strengthByDistance
public boolean strengthByDistance()Returns the value of thestrengthByDistancerecord component.- Returns:
- the value of the
strengthByDistancerecord component
-
invertDistanceModifier
public boolean invertDistanceModifier()Returns the value of theinvertDistanceModifierrecord component.- Returns:
- the value of the
invertDistanceModifierrecord component
-