Particle-world collision via AABB checks against obstacle list. Designed for lightweight debris/spark bouncing, not full physics.
Usage:
const collision = new ParticleCollision();collision.addObstacle({ x: 0, y: 500, width: 800, height: 20 }); // floor// In particle update loop:collision.resolve(particle); // bounces particle off obstacles Copy
const collision = new ParticleCollision();collision.addObstacle({ x: 0, y: 500, width: 800, height: 20 }); // floor// In particle update loop:collision.resolve(particle); // bounces particle off obstacles
Particle-world collision via AABB checks against obstacle list. Designed for lightweight debris/spark bouncing, not full physics.
Usage: