Attractor class

A point that pulls particles toward it (positive strength) or pushes them away (negative strength) while they're within radius.

Force falls off linearly with distance — full strength at the attractor's center, zero at radius. position is a callback so the attractor can follow a moving point (e.g. the user's finger) every frame.

Constructors

Attractor({required Offset position(), required double strength, required double radius})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
position Offset Function()
Attractor's location, evaluated fresh every frame.
final
radius double
Distance beyond which the attractor has no effect.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
strength double
Force magnitude at the attractor's center. Positive pulls particles in, negative pushes them away.
final

Methods

forceOn(Offset particlePosition, double deltaTime) Offset
Returns the velocity delta this attractor applies to a particle at particlePosition over deltaTime.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited