Class PointAttractorForceData
- All Implemented Interfaces:
EditorAttributeProvider,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
DIRECT_CODEC, 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) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddModules(ParticleModuleSet.Builder builder) ModuleType<?> getType()booleanbooleanorg.joml.Vector3dcposition()floatrange()voidRenders all ImGui attributes into the current editor panel.floatstrength()boolean
-
Field Details
-
CODEC
-
-
Constructor Details
-
PointAttractorForceData
public PointAttractorForceData(org.joml.Vector3dc position, boolean localPosition, float range, float strength, boolean strengthByDistance, boolean invertDistanceModifier)
-
-
Method Details
-
addModules
- Specified by:
addModulesin interfaceParticleModuleData
-
getType
- Specified by:
getTypein interfaceParticleModuleData
-
renderImGuiAttributes
public void renderImGuiAttributes()Description copied from interface:EditorAttributeProviderRenders all ImGui attributes into the current editor panel.- Specified by:
renderImGuiAttributesin interfaceEditorAttributeProvider
-
position
public org.joml.Vector3dc position() -
localPosition
public boolean localPosition() -
range
public float range() -
strength
public float strength() -
strengthByDistance
public boolean strengthByDistance() -
invertDistanceModifier
public boolean invertDistanceModifier()
-