/ghibli-threejs:threejs-first-person-bvh-walkfrom ghibli-threejs
Provides a first-person character controller for three.js using three-mesh-bvh capsule collision that never gets stuck on walls, stairs, or seams. Includes WASD movement, pointer-lock look, run, use, over-shoulder view, and a flood-fill soak test.
Ships in ghibli-threejs. 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.
Click the landmark (or press a key) and {{character}} floats down onto the arrival spot; the
camera watches from a three-quarter view, then slides into her eyes. You walk the whole
thing — terraces, stairs, balconies, furnished rooms — and nothing ever traps you. Proven on
a Laputa-style floating castle (≈120k tris, six rooms, a lift to an observatory), where a
30-visitor soak test went from 110 lock checkpoints to 0.
Stack: three.js r186, three-mesh-bvh 0.9.1 (build/index.module.js, imports bare three
so it resolves through the import map; +esm pulls a second copy of three), a landmark GLB
from a Blender generator (threejs-floating-island-landmark, threejs-blender-glb-pipeline).
Let me visit
{{landmark}}on foot. Clicking it (or{{key}}) floats{{character}}down onto{{arrival spot}}; the camera watches from a three-quarter view, then slides into her eyes. WASD/arrows walk (arrows left/right turn), mouse looks with pointer lock (drag as a fallback), Shift runs, E uses, V toggles an over-shoulder view with a walk cycle, Esc leaves (the first Esc only releases the mouse). On touch: a thumb stick that appears under the left thumb, the right half looks, E and view buttons.Make the building enterable in the generator: hollow shell, a separate interior material, archways, a
walk.jsonwith spawn, lamps[pos, rgb, intensity, range], things to use and room boxes.Collision: one three-mesh-bvh over every static mesh in the landmark's frame; a capsule pushed out sideways; ground = highest floor under a small footprint; sub-steps ≤ 12 cm; at an edge retry the step turned along it; every drop ≤
{{drop}}must be climbable back (outdoors, hop ≤{{climb}}onto ≥ 1 m of level ground or her own trail); a breadcrumb trail leads her back if she presses on and goes nowhere for 0.5 s. Prove it headless: flood-fill reachability from the spawn and a 30 × 90 s random-wander soak with lock checks.
walk.p in model metres), so its bob
and spin carry her. Camera = isle.localToWorld(eye), quaternion = isle world quaternion ×
local yaw/pitch (Euler YXZ).descend (from 26 m, eased (1−u)^2.3, a slow turn, arms out) → enter (1.7 s
lerp/slerp from the watch pose into the eye, fov to 68, hide her at 72 %) → walk ↔
float (lift) → endWalk flies back to the orbit.addEventListener(…, true) + stopImmediatePropagation)
silences the rest of the scene's shortcuts while walking.WALK)eye 1.5, radius .34, step .56, drop 1.25, climb 1.32, speed 2.7, run 5.4, fov 68.
Stair treads must be deeper than the radius, wall probes start above step height.
references/walk-controller.js)inv(isle.matrixWorld) · mesh.matrixWorld, positions + index only; build
MeshBVH once on the first walk.p.y + step down; accept only |n.y| > .6.y + step + .6r to y + 1.62 − r; bvh.shapecast with
tri.closestPointToSegment; push sideways only by r − d, 3 passes. Dead-centre on a
face → push along the face normal.[0, ±.5, ±1, ±1.35] rad, scaled by max(0, cos), so rails and cliffs are
glanced along. Accept only if ground exists, is ≤ drop below, and a step up has room for
the body at the new height (walkFits).step < h ≤ climb ahead
is hopped onto if the landing is solid (8 points at .45 m all within .1 m) or on her own
trail, and the body fits there.stuckT grows while input > .2 but
speed < 25 % of intended; after .5 s walk back toward the nearest crumb that lies roughly
in the wanted direction (|dy| ≤ climb). Clear the trail after a lift ride.envMapIntensity .12, and add the four lamps nearest the eye (view space) after
lights_fragment_end; outdoor shaders pay nothing. The same patch on the character with an
eased 0…1 factor as she walks in and out.BLENDER_USER_RESOURCES profile so the user's Blender is untouched.makehuman_system_assets and dress01 packs.game_engine rig.R⁻¹·Q·R), and export them as NLA tracks.gltf-transform optimize (Draco, WebP at 1024) the character with all four clips is about 0.7 MB.AnimationMixer plays every clip and cross-fades their weights on speed (1 − exp(−7·dt); run
above 1.3× walk speed). Walk timeScale = speed/1.35 (clamped .6–2.2) and run speed/4.4 (.7–1.4), so the
feet don't skate. Keep the toy as the load-failure fallback.alphaTest .5, or the eye renders white.BLEND. Set skin, dress and shoes opaque, and hair to alphaTest.references/walk-soak-test.mjs)Expose walkMove, walkGround, walk on a debug handle. Flood-fill: from the spawn,
8 headings × 0.3 s of real walkMove, bucket to 1 m cells, BFS. Hug-and-return: from
every cell walk 1.6 s into whatever is there, then try to walk back. Soak: 30 visitors ×
90 s, random heading changes every 1–4 s, a lock check every 5 s (moved < .3 m while pressing).
Diff reachable sets between versions: a stricter rule once cut off the lower lawns.
gl_PointSize clamped to 1–6 px, or they are bokeh balls at 1 m.keydown W events, ride the lift, walk the top.references/walk-controller.js — BVH build, floor/ground/collide/fits/solid/climb/step/trail/unstick/move.references/walk-soak-test.mjs — Playwright flood-fill + hug-and-return + random-wander soak.threejs-floating-island-landmark · threejs-blender-glb-pipeline · threejs-object-interaction · threejs-camera-guided-tour · threejs-skeletonless-character-animation · threejs-headless-visual-verification
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub nicksonthc/ghibli-threejs --plugin ghibli-threejsOther plugins' skills for the same job
31 skills in this plugin
/threejs-blender-glb-pipelineBuilds a reference-image-driven asset pipeline from headless Blender to GLB for a three.js scene — an asset contract (units, axes, grounding, required mesh/material names, budgets, attachment numbers), one parallel subagent per asset group writing craft_<slug>.py generators, preview renders compared against the reference, measured-bounding-box placement in the web scene, Draco compression, and a scored asset quality pass. Use when the user has a reference picture and wants a 3D scene from it, asks to model props/trees/characters in Blender for three.js, export GLBs, fix glTF export issues (vertex-colour alpha, UV flip, axes, custom normals), compress models, or rate and improve every asset in a scene./threejs-boat-buoyancy-steeringFloats a boat (or any buoyant prop) on three.js water with Gerstner waves generated from one JS table that feeds both the GLSL vertex shader and a CPU waveHeight(), four-probe heave/pitch/roll damped springs, an arc-length drift lane that bends round rocks, click-to-steer W/A/S/D rowing with momentum and drag, an autopilot that pursues the lane back, and a chase camera that keeps the orbit. Use when the user wants a drifting or steerable boat, buoyancy, objects bobbing on waves, Gerstner waves on a river/lake, a boat autopilot, or a follow/chase camera behind a vehicle on water.