threejs-physics — скилл для Claude Code: что делает и как установить
Скилл threejs-physics для Claude Code помогает связать Three.js с физическим движком вроде Rapier. Настраивает коллайдеры, фиксированный шаг симуляции и синхронизацию трансформаций с рендером.
MIT 611 установок ★ 26 обновлён 2026-09-10
npx skills add cesartevisual/threejs-skills --skill threejs-physics -a claude-codeЧто делает threejs-physics
Скилл инструктирует агента по интеграции физики в сцены Three.js. Он требует инициализировать рантайм WASM до создания физического мира, задавать направление гравитации и явно определять, какая система управляет координатами объектов.
Симуляция обновляется с фиксированным шагом через ограниченный аккумулятор времени. Кинематические тела перемещаются строго через вызовы API движка, потому что прямая запись в матрицы мешей Three.js ломает физику. Для стабильности скилл рекомендует примитивные и составные коллайдеры вместо динамических полигональных сеток.
При удалении сцены скилл напоминает освобождать объекты физического мира и слушатели событий. Непрерывное обнаружение столкновений (CCD) включается точечно только для быстрых тел из-за вычислительной нагрузки.
Какие задачи решает
- синхронизировать физические координаты Rapier с мешами Three.js
- настроить фиксированный шаг симуляции с защитой от просадок кадров
- создать примитивные и составные коллайдеры для 3D-моделей
- организовать очистку физического мира и слушателей событий при размонтировании
Примеры запросов агенту
- Подключи Rapier к сцене Three.js и настрой падение куба на плоскость
- Сделай фиксированный шаг симуляции с интерполяцией рендера для Three.js
- Добавь кинематическое тело через API физического движка
Как установить threejs-physics
1Через Skills CLI (Vercel)
npx skills add cesartevisual/threejs-skills --skill threejs-physics -a claude-code2Вручную: положить файлы
~/.claude/skills/threejs-physics/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/threejs-physics/
1Через Skills CLI (Vercel)
npx skills add cesartevisual/threejs-skills --skill threejs-physics -a codex2Вручную: положить файлы
.agents/skills/threejs-physics/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add cesartevisual/threejs-skills --skill threejs-physics -a cursor2Вручную: положить файлы
.cursor/skills/threejs-physics/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install cesartevisual/threejs-skills skills/threejs-physics2Вручную: положить файлы
.github/skills/threejs-physics/SKILL.md1Через Skills CLI (Vercel)
npx skills add cesartevisual/threejs-skills --skill threejs-physics -a gemini-cli2Командой платформы
gemini skills install https://github.com/cesartevisual/threejs-skills --path skills/threejs-physicsВручную: положить файлы
.devin/skills/threejs-physics/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add cesartevisual/threejs-skills --skill threejs-physics -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о threejs-physics
Как установить threejs-physics в Claude Code?
Выполните команду npx skills add cesartevisual/threejs-skills --skill threejs-physics -a claude-code. Также можно вручную поместить файл инструкции в путь ~/.claude/skills/threejs-physics/SKILL.md.
Что делает threejs-physics?
Скилл направляет ИИ-агента при настройке физики в Three.js, задавая правила работы с коллайдерами, циклом симуляции и синхронизацией мешей.
Какие ограничения учитывает скилл при работе с мешами?
Визуальная сетка Three.js не считается автоматически стабильным коллайдером, поэтому скилл ограничивает использование динамических треугольных сеток и требует применять примитивные формы.
Исходный текст
SKILL.md · MIT
--- name: threejs-physics description: "Integrate Rapier or another physics engine with Three.js, including colliders, fixed timesteps, and render synchronization." --- # Physics Integration Use the project's installed versions and existing architecture. These instructions supplement the user's task; they do not authorize unrelated changes or external actions. Inspect the existing engine and its version; preserve it unless the requested behavior requires a change. Initialize its WASM/runtime before creating the world. Establish units, gravity direction, collider scale, and authority over each transform. Advance simulation with a fixed timestep and a bounded accumulator. Cap substeps and explicitly choose whether to discard excess elapsed time after a stall. Interpolate previous/current physics poses for rendering when needed. Avoid stepping the simulation from multiple loops. Prefer primitive or compound colliders where they reproduce the interaction adequately. Check engine restrictions for dynamic triangle meshes, scaling, and convex hulls. A visual mesh is not automatically a stable collider. Use continuous collision detection selectively for fast bodies after measuring its cost. Move kinematic bodies through engine APIs; do not write render transforms and expect physics to follow. Apply forces/impulses at the intended cadence, and handle sleeping and collision event lifetime. Keep event processing from triggering duplicate UI actions. Release world objects and listeners on teardown. Test collisions at the highest expected velocity, resting stability, low frame rates, tab resume, scale changes, and repeated resets. Do not promise deterministic cross-platform replay without testing the selected engine and configuration. ## API reference Consult the [official documentation](https://rapier.rs/docs/user_guides/javascript/integration_parameters/) for exact signatures and revision-specific behavior. If documentation access is unavailable, inspect installed types/source and state any remaining uncertainty.
© cesartevisual · MIT · cesartevisual/threejs-skills