Physics rendering expert

From curiositech/some_claude_skills · View interactive version

Physics rendering expert is an AI agent skill from the GitHub repository curiositech/some_claude_skills. Real-time rope/cable physics using Position-Based Dynamics (PBD), Verlet integration, and constraint solvers. Expert in quaternion math, Gauss-Seidel/Jacobi solvers, and tangling detection. Activate on 'rope simulation', 'PBD', 'Position-Based Dynamics', 'Verlet', 'constraint solver', 'quaternion',

How to use this skill

Skill file

Physics & Rendering Expert: Rope Dynamics & Constraint Solving

Expert in computational physics for real-time rope/cable dynamics, constraint solving, and physically-based simulations.

When to Use This Skill

Use for:

Do NOT use for:

Expert vs Novice Shibboleths

| Topic | Novice | Expert |

|-------|--------|--------|

| Constraint approach | Uses spring forces (F=ma) | Uses PBD (directly manipulates positions) |

| Why PBD | "Springs work fine" | Springs require tiny timesteps; PBD is unconditionally stable |

| Solver choice | "Just iterate until done" | Gauss-Seidel for chains, Jacobi for GPU |

| Iterations | 20+ iterations | 5-10 is optimal; diminishing returns after |

| Rotation | Uses Euler angles | Uses quaternions (no gimbal lock) |

| Integration | Forward Euler | Verlet (symplectic, energy-conserving) |

Common Anti-Patterns

Force-Based Springs for Stiff Constraints

| What it looks like | Why it's wrong |

|--------------------|----------------|

| force = k * (distance - rest_length) with high k | High k requires tiny dt for stability; low k gives squishy ropes |

| Instead: Use PBD - directly move particles to satisfy constraints |

Euler Angles for Rotation

| What it looks like | Why it's wrong |

|--------------------|----------------|

| rotation = vec3(pitch, yaw, roll) | Gimbal lock at 90° pitch; unstable composition |

| Instead: Use quaternions - 4 numbers, no gimbal lock, stable SLERP |

Over-Iteration

| What it looks like | Why it's wrong |

|--------------------|----------------|

| solver_iterations = 50 | Diminishing returns after 5-10; wastes cycles |

| Instead: Use 5-10 iterations; if more needed, use XPBD compliance |

Single-Threaded Gauss-Seidel for Large Systems

| What it looks like | Why it's wrong |

|--------------------|----------------|

| Gauss-Seidel on 1000+ constraints | Gauss-Seidel is inherently sequential |

| Instead: Use Jacobi solver for GPU parallelization |

Quick Reference

Why PBD Beats Force-Based Physics

Solver Choice

| Solver | Parallelizable | Convergence | Use Case |

|--------|---------------|-------------|----------|

| Gauss-Seidel | No | Fast | Chains, ropes |

| Jacobi | Yes (GPU) | Slower | Large meshes, cloth |

Rotation Representation

Performance Targets

| System | Budget | Notes |

|--------|--------|-------|

| Single rope (100 particles) | <0.5ms | 5 iterations sufficient |

| Three-dog leash (60 particles) | <0.7ms | Include tangle detection |

| Cloth (1000 particles) | <2ms | Use Jacobi on GPU |

Evolution Timeline

| Era | Key Development |

|-----|-----------------|

| Pre-2006 | Mass-spring systems, stability issues |

| 2006-2015 | PBD introduced (Müller et al.), unconditional stability |

| 2016-2020 | XPBD adds compliance for soft constraints |

| 2021-2024 | ALEM (2024 SIGGRAPH), BDEM, neural physics |

| 2025+ | XPBD standard, hybrid CPU/GPU, learned corrections |

Decision Trees

Choosing constraint solver:

Choosing integration:

Integrates With

Reference Files

| File | Contents |

|------|----------|

| references/core-algorithms.md | PBD loop, Verlet, quaternions, solver implementations |

| references/tangle-physics.md | Multi-rope collision, Capstan friction, TangleConstraint |


Remember: Real-time physics is about stability and visual plausibility, not physical accuracy. PBD with 5-10 iterations at 60fps looks great and runs fast.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.