- Home
- Skills
- Bbeierle12
- Skill Mcp Claude
- Particles Physics
particles-physics_skill
- JavaScript
6
GitHub Stars
2
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill bbeierle12/skill-mcp-claude --skill particles-physics- _meta.json349 B
- SKILL.md14.5 KB
Overview
This skill implements a compact, practical particle physics toolkit for JavaScript-based simulations. It provides common forces (gravity, wind, drag), attractors/repulsors, velocity and vortex fields, turbulence generators, collision handlers, and multiple integration methods for both artistic and physically plausible motion. Designed for GPU or CPU workflows, it fits visual effects, interactive swarms, and field-driven animations.
How this skill works
The skill operates on typed arrays for positions and velocities and exposes modular functions you call each frame: apply forces to velocity, integrate positions, then run collision or constraint handlers. It supports CPU routines (gravity, wind, drag, attractors, turbulence, vortex, flow fields) and shader-ready patterns (curl noise, turbulence) for high-performance GPU implementations. Integration options include Euler, Verlet, and RK4 to trade off speed and accuracy.
When to use it
- Creating realistic gravity, wind, or drag-driven particle motion in a scene.
- Animating swarms, flocking, or orbiting behavior using attractors and orbit forces.
- Generating organic flow-based motion with curl noise or 3D flow fields.
- Adding turbulence or vortex effects for artistic distortions.
- Handling simple collisions against planes or spheres in real time.
Best practices
- Use typed Float32Array buffers for positions and velocities to minimize GC and maximize GPU upload performance.
- Apply forces to velocities, then integrate positions in a single update loop to keep deterministic behavior.
- Prefer Verlet for constraint-heavy systems, Euler for speed, and RK4 when high precision is required.
- Clamp or guard against zero-distance when computing inverse-square or normalized forces to avoid instability.
- Combine coarse CPU updates with shader-based curl noise for large particle counts to balance fidelity and performance.
Example use cases
- Real-time smoke or dust driven by wind + turbulence in a WebGL scene.
- Particle swarms attracted to multiple dynamic targets with smooth falloff radii.
- Orbiting debris around a moving center using orbit attractors and drag damping.
- Decorative vortex effects around a model using axis-aligned vortex fields.
- Containment or rebound behavior using sphere/plane collisions for interactive sand or bubble effects.
FAQ
Use the CPU for small to medium particle counts or when logic is complex; move repetitive per-particle noise and curl computations into shaders for large counts to improve performance.
How do I avoid numerical instability with strong forces?
Reduce timestep or switch to a higher-order integrator (Verlet or RK4), clamp force magnitudes, and ensure you avoid division by very small distances when normalizing.