Class SimplePositionedForce
java.lang.Object
foundry.veil.api.quasar.emitters.module.force.SimplePositionedForce
- All Implemented Interfaces:
PositionedForce
,ForceParticleModule
,ParticleModule
- Direct Known Subclasses:
PointAttractorForceModule
,PointForceModule
,VortexForceModule
public abstract class SimplePositionedForce
extends Object
implements ForceParticleModule, PositionedForce
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected final org.joml.Vector3d
-
Constructor Summary
ModifierConstructorDescriptionprotected
SimplePositionedForce
(org.joml.Vector3dc position, boolean localPosition) protected
SimplePositionedForce
(org.joml.Vector3d position, boolean localPosition) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.joml.Vector3d
getDeltaPosition
(QuasarParticle particle) org.joml.Vector3d
boolean
void
setForceOrigin
(double x, double y, double z) Directly sets the force origin to a global position.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface foundry.veil.api.quasar.emitters.module.ForceParticleModule
applyForce, setStrength
Methods inherited from interface foundry.veil.api.quasar.emitters.module.ParticleModule
onRemove
Methods inherited from interface foundry.veil.api.quasar.emitters.module.force.PositionedForce
setForceOrigin
-
Field Details
-
position
protected final org.joml.Vector3d position -
localPosition
protected boolean localPosition
-
-
Constructor Details
-
SimplePositionedForce
protected SimplePositionedForce(org.joml.Vector3d position, boolean localPosition) -
SimplePositionedForce
protected SimplePositionedForce(org.joml.Vector3dc position, boolean localPosition)
-
-
Method Details
-
getDeltaPosition
-
getPosition
public org.joml.Vector3d getPosition()- Specified by:
getPosition
in interfacePositionedForce
- Returns:
- The position of this force in emitter-relative space if
PositionedForce.isLocalPosition()
istrue
-
isLocalPosition
public boolean isLocalPosition()- Specified by:
isLocalPosition
in interfacePositionedForce
- Returns:
- Whether the position of this force is relative to the emitter
-
setForceOrigin
public void setForceOrigin(double x, double y, double z) Description copied from interface:PositionedForce
Directly sets the force origin to a global position.- Specified by:
setForceOrigin
in interfacePositionedForce
- Parameters:
x
- The new origin position Xy
- The new origin position Yz
- The new origin position Z
-