New advertisers: 50% off your first month with code FIRSTMONTHSee slots
enzed avatar

R3f Physics

React Three Fiber physics with Rapier: rigid bodies, colliders, forces, sensors, joints, and character controllers.

skills.sh installs
2.1K
GitHub stars
138
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers dynamic, fixed, and kinematic RigidBody setup, colliders, impulses and persistent forces, and fixed-timestep simulation behavior
  • Includes sensor intersection events, collision groups, joints using local anchors, and a step-aligned kinematic platform reference
  • Enforces separation of rendering and simulation ownership, so simulated meshes are not animated directly in useFrame
  • Designed for collision-driven movement and simulation in projects on Fiber 9, React 19, and Rapier 2

Install

$ npx -y skills add enzed/r3f-skills --skill r3f-physics -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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>
  )
}

Details

Repository
github.com/enzed/r3f-skills
Categories
3D, CAD & Modeling, Frontend & UI Code, Game Development
First seen
May 16, 2026

More from enzed/r3f-skills

All 11

Similar to R3f Physics

More 3D, CAD & Modeling