tsParticles - v4.5.3
    Preparing search index...

    Fluid collision solver, a density based displacement solver (DDR) working on particle neighborhoods.

    It replaces the pair impulse resolution used by the other collision modes, since a fluid response needs the local density of the neighborhood, not a single pair contact.

    The solver only moves positions and never velocities: the movement plugin and gravity keep owning the velocity, the fluid adds a position response on top of it. Feeding the displacement back into the velocity turns the work done against the non-penetration constraint into kinetic energy, and with no damping in the loop the pool would gain energy every frame instead of settling.

    The solver is executed in a single pass over the particles, using the positions updated by the already solved particles of the same frame, so a small order bias is expected.

    Index
    • Prevents particles from overlapping, projecting every pair closer than the sum of their radii back to exactly the contact distance.

      The density/pressure solve is a soft response: it only pushes while the local density exceeds restDensity, and the resulting force is clamped by maxForce, so it can always leave a few particles touching or slightly interpenetrating. This hard constraint closes that gap, making visible overlaps impossible without raising nearStiffness/maxForce (doing that injects enough energy to turn the pool into a chaotic, endlessly bouncing gas).

      Parameters

      • particle: CollisionParticle

        the particle being solved

      • position: Vector3d

        the position of the particle being solved

      • Optionalmargin: number

        optional minimum distance from the canvas borders

      • OptionalmaxX: number

        optional maximum horizontal position

      • OptionalmaxY: number

        optional maximum vertical position

      Returns void