— No reviews yet
0 installs
6 views
0.0% view→install
Install
$ agentstack add skill-bbeierle12-skill-mcp-claude-particles-physics ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ● Network access Used
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Are you the author of Particles Physics? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claimAbout
Particle Physics
Apply forces, fields, and constraints to create dynamic particle motion.
Quick Start
// Simple gravity + velocity
useFrame((_, delta) => {
for (let i = 0; i 0) {
const dragForce = coefficient * speed * speed;
const factor = Math.max(0, 1 - (dragForce * delta) / speed);
velocities[i * 3] *= factor;
velocities[i * 3 + 1] *= factor;
velocities[i * 3 + 2] *= factor;
}
}
}
Attractors & Repulsors
Point Attractor
function applyAttractor(
velocities: Float32Array,
positions: Float32Array,
count: number,
attractorPos: THREE.Vector3,
strength: number, // Positive = attract, negative = repel
delta: number
) {
for (let i = 0; i 0.1) { // Avoid division by zero
// Inverse square falloff
const force = strength / distSq;
velocities[i * 3] += (dx / dist) * force * delta;
velocities[i * 3 + 1] += (dy / dist) * force * delta;
velocities[i * 3 + 2] += (dz / dist) * force * delta;
}
}
}
Orbit Attractor
function applyOrbitAttractor(
velocities: Float32Array,
positions: Float32Array,
count: number,
center: THREE.Vector3,
orbitStrength: number,
pullStrength: number,
delta: number
) {
for (let i = 0; i 0.1) {
// Tangential force (orbit)
const tx = -dz / dist;
const tz = dx / dist;
velocities[i * 3] += tx * orbitStrength * delta;
velocities[i * 3 + 2] += tz * orbitStrength * delta;
// Radial force (pull toward center)
velocities[i * 3] -= (dx / dist) * pullStrength * delta;
velocities[i * 3 + 1] -= (dy / dist) * pullStrength * delta;
velocities[i * 3 + 2] -= (dz / dist) * pullStrength * delta;
}
}
}
Multiple Attractors
interface Attractor {
position: THREE.Vector3;
strength: number;
radius: number; // Influence radius
}
function applyAttractors(
velocities: Float32Array,
positions: Float32Array,
count: number,
attractors: Attractor[],
delta: number
) {
for (let i = 0; i 0.1 && dist 0.1) {
// Tangent direction (cross product with axis)
const tx = axis.y * pz - axis.z * py;
const ty = axis.z * px - axis.x * pz;
const tz = axis.x * py - axis.y * px;
const tLen = Math.sqrt(tx * tx + ty * ty + tz * tz);
const force = strength * Math.exp(-dist * falloff);
velocities[i * 3] += (tx / tLen) * force * delta;
velocities[i * 3 + 1] += (ty / tLen) * force * delta;
velocities[i * 3 + 2] += (tz / tLen) * force * delta;
}
}
}
Turbulence
Simplex-Based Turbulence
// GPU turbulence in vertex shader
vec3 turbulence(vec3 p, float time, float scale, int octaves) {
vec3 result = vec3(0.0);
float amplitude = 1.0;
float frequency = scale;
for (int i = 0; i radius : dist 0) {
const nx = dx / dist;
const ny = dy / dist;
const nz = dz / dist;
// Move to surface
const targetDist = inside ? radius : radius;
positions[i * 3] = center.x + nx * targetDist;
positions[i * 3 + 1] = center.y + ny * targetDist;
positions[i * 3 + 2] = center.z + nz * targetDist;
// Reflect velocity
const dot = velocities[i * 3] * nx + velocities[i * 3 + 1] * ny + velocities[i * 3 + 2] * nz;
velocities[i * 3] = (velocities[i * 3] - 2 * dot * nx) * bounce;
velocities[i * 3 + 1] = (velocities[i * 3 + 1] - 2 * dot * ny) * bounce;
velocities[i * 3 + 2] = (velocities[i * 3 + 2] - 2 * dot * nz) * bounce;
}
}
}
Integration Methods
Euler (Simple)
// Fastest, least accurate
position += velocity * delta;
velocity += acceleration * delta;
Verlet (Better for constraints)
// Store previous position
const newPos = position * 2 - prevPosition + acceleration * delta * delta;
prevPosition = position;
position = newPos;
RK4 (Most accurate)
// Runge-Kutta 4th order (for high precision)
function rk4(position: number, velocity: number, acceleration: (p: number, v: number) => number, dt: number) {
const k1v = acceleration(position, velocity);
const k1x = velocity;
const k2v = acceleration(position + k1x * dt/2, velocity + k1v * dt/2);
const k2x = velocity + k1v * dt/2;
const k3v = acceleration(position + k2x * dt/2, velocity + k2v * dt/2);
const k3x = velocity + k2v * dt/2;
const k4v = acceleration(position + k3x * dt, velocity + k3v * dt);
const k4x = velocity + k3v * dt;
return {
position: position + (k1x + 2*k2x + 2*k3x + k4x) * dt / 6,
velocity: velocity + (k1v + 2*k2v + 2*k3v + k4v) * dt / 6
};
}
File Structure
particles-physics/
├── SKILL.md
├── references/
│ ├── forces.md # All force types
│ └── integration.md # Integration methods comparison
└── scripts/
├── forces/
│ ├── gravity.ts # Gravity implementations
│ ├── attractors.ts # Point/orbit attractors
│ └── fields.ts # Flow/velocity fields
└── collision/
├── planes.ts # Plane collision
└── shapes.ts # Sphere, box collision
Reference
references/forces.md— Complete force implementationsreferences/integration.md— When to use which integration method
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: Bbeierle12
- Source: Bbeierle12/Skill-MCP-Claude
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.