ParticlePhysics class
Constructors
-
ParticlePhysics({double gravityScale = 9.8, List<
Attractor> attractors = const [], double? maxSpeed}) -
const
Properties
-
attractors
→ List<
Attractor> -
Attraction/repulsion points applied every frame alongside gravity.
final
- gravityScale → double
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxSpeed → double?
-
Caps particle speed after gravity/attractors are applied. Without a
cap, attractors can accelerate particles indefinitely as they pass
close to the attractor's center every frame.
null= no cap.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
applyAttractors(
Offset position, double deltaTime) → Offset -
Sums every attractor's force on a particle at
positioninto a velocity delta for this frame. -
applyGravity(
Offset velocity, double deltaTime) → Offset -
clampSpeed(
Offset velocity) → Offset -
Clamps
velocityto maxSpeed if set, preserving direction. -
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