/threejs-skills:threejs-physicsfrom three.js Skills
Rigid-body physics for three.js and R3F with Rapier: colliders from glTF models, dynamic and kinematic bodies, collision events, character controllers. Use when objects fall, collide, get thrown or walked on. Hands off to `threejs-performance`.
Ships in three.js Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Rapier (@dimforge/rapier3d-compat 0.21, @react-three/rapier 2.2) is the default physics engine for three.js
work: WASM, deterministic, with character controllers and good React bindings. Most physics bugs are scale and
shape problems, not engine problems: bodies in centimeters fall 100 times too slowly, triangle-mesh colliders on
moving bodies tunnel or explode, and rendering at a variable rate while stepping at it makes motion jitter.
Inspect every model that gets a collider (threejs-model-inspect): scale must be meters (fix scale-large
first; physics in centimeters behaves like slow motion), and note which nodes are the floor, walls and props.
Choose collider shapes per object, cheapest that fits:
| Object | Body | Collider |
|---|---|---|
| Floor, walls, level geometry | fixed | trimesh (static only) or cuboids |
| Props that move | dynamic | cuboid, ball, capsule, or convex hull |
| Concave props that move (chairs, cups) | dynamic | several convex shapes, never trimesh |
| Player | kinematicPosition + character controller | capsule |
| Triggers (pickups, zones) | fixed | sensor collider |
Read the recipe file for the stack: references/vanilla.md or references/r3f.md.
Step the world at a fixed rate (60 Hz) decoupled from rendering, and interpolate or sync transforms after the
step. @react-three/rapier does this with timeStep={1/60} and interpolate (the defaults).
Turn on the debug view while building (debug prop, or world.debugRender() lines) and check that every
collider hugs its mesh. Turn it off before shipping.
Test edge cases on screen: fast objects (enable CCD), stacking (sleeping, friction), and the player on slopes and steps (autostep, snap to ground).
setTranslation, applyImpulse, setLinvel) or make them kinematic.world.step() once per rendered frame on 120 Hz screens: physics runs twice as fast. Accumulate time and step at
a fixed rate.Next: threejs-performance if body counts grow (instancing with InstancedRigidBodies, sleeping, simpler shapes).
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub emiliodominguez/threejs-skills --plugin threejs-skills28 skills in this plugin
/threejsMap of the threejs-* skills for three.js and React Three Fiber work: 3D models, scenes, materials, lighting, animation, shaders, performance and model generation. Use when a 3D web task spans several areas or the right skill is unclear. Routes to `threejs-model-inspect` and the rest of the suite./threejs-animationKeyframe, skeletal and morph-target animation, procedural motion and clip blending, on WebGL or with WebGPU and TSL. Use when animating objects, playing glTF animations, posing bones, driving morph targets, or mixing and crossfading clips./threejs-asset-pipelineShrinking glTF assets for three.js with gltf-transform: inspect, validate and optimize commands, Draco, meshopt and quantization, KTX2, WebP and AVIF textures, the loader setup each output needs, and gltfjsx for React. Use when compressing, optimizing or validating 3D models before loading them.Other plugins' skills for the same job