model/particlemodel library
Particle data model and physics logic.
This library defines the Particle class and helper functions for calculating velocity and simulating particle behavior.
Classes
- Particle
- The Particle class represents a single particle in the particle network. It contains properties for position, velocity, color, size, and visibility.
Functions
-
computeVelocity(
Offset currentVelocity, Offset defaultVelocity, double speedThreshold) → Offset - Computes the velocity with gradual decay to return to the default velocity.
-
createMockParticle(
{Offset? position, Offset? velocity, Color? color, double? size}) → Particle - Utility function to create a mock particle for testing.