enzed avatar

R3f Physics

This brings React Three Fiber physics through the Rapier engine, giving you RigidBody components, colliders, forces, and joints for 3D web scenes. You wrap your meshes in RigidBody tags, set types like dynamic or fixed, and let gravity and collisions handle the rest. The colliders auto-generate from geometry or you can place them manually with CuboidCollider, BallCollider, and friends. Forces apply through refs with methods like applyImpulse and addForce. It's genuinely well designed for the R3F ecosystem, the debug wireframes are helpful, and the on-demand rendering integration means physics don't tank your frame rate when nothing's moving.

skills.sh installs
2K
GitHub stars
135
last updated
Aug 21, 2026

Install

$ npx -y skills add enzed/r3f-skills --skill r3f-physics --agent claude-code

Installs into .claude/skills of the current project.

Files

React Three Fiber physics

Check installed Fiber, React, and Rapier versions. Rapier 2 targets Fiber 9 / React 19; older projects need their compatible package line. Keep rendering and simulation ownership separate.

Falling and clickable body

Mount beneath Canvas with lighting. Physics loads WASM asynchronously; include Suspense. Cuboid collider arguments are half-extents, unlike BoxGeometry's full dimensions.

import { Suspense, useRef } from 'react'
import { CuboidCollider, Physics, RigidBody, type RapierRigidBody } from '@react-three/rapier'

function FallingBox() {
  const body = useRef<RapierRigidBody>(null)
  return (
    <RigidBody ref={body} position={[0, 2, 0]} colliders="cuboid" restitution={0.2}>
      <mesh name="physics-box" onClick={() => body.current?.applyImpulse({ x: 0, y: 3, z: 0 }, true)}>
        <boxGeometry />
        <meshStandardMaterial color="coral" />
      </mesh>
    </RigidBody>
  )
}

Sponsors

Details

Repository
github.com/enzed/r3f-skills
Categories
Frontend Development, Go, Game Development
First seen
May 16, 2026

More from enzed/r3f-skills

All 11
1nvidia avatardynamo-troubleshootnvidia/skillsDiagnose failed or unhealthy Dynamo deployments. Use when pods, model-cache jobs, PVCs, workers, frontend/router health, endpoints, or benchmark jobs fail; use 1.9Kskills.sh installs
2nexu-io avatarreference-design-contractnexu-io/open-designTurn vague taste, screenshots, URLs, product notes, or "make it feel like this" references into a grounded DESIGN.md plus an implementation handoff. Use it befo1.9Kskills.sh installs
3jimmylv avatarbibijimmylv/bibigpt-skillAI video & audio summarizer + repackager. Summarize YouTube, Bilibili, podcasts, TikTok, Twitter/X, Xiaohongshu, and any online video or audio, then optionally 1.9Kskills.sh installs
4cognitedata avatarintegrate-todo-listcognitedata/builder-skillsMUST be used whenever adding a task/todo list feature to a Flows app with Atlas chat. Do NOT manually create todo state management or tool definitions — this sk1.9Kskills.sh installs
5cognitedata avatarsetup-flows-authcognitedata/builder-skillsMUST be used when migrating an existing React app to Flows, or when no Flows auth is wired up. Detects classic vs Apps API flow from `app.json` `infra` field, i1.9Kskills.sh installs
6enzed avatarr3f-texturesenzed/r3f-skillsReact Three Fiber textures - useTexture, texture loading, environment maps, texture configuration. Use when loading images, working with PBR texture sets, cubem1.9Kskills.sh installs