zen: rebuild UB locomotion — real 3D steering + motionRoot/visualRig split (Codex)
Not a tuning pass — a locomotion rebuild per Codex's review. Replaces the X-axis shuttle +
scripted 180° U-turn with a proper 3D steering controller (behavior.js): UB seeks wandering
waypoints through the whole tank (XYZ incl. near/far depth passes), eases speed via limited
accel, steers with a rate-limited quaternion toward its velocity, banks into curves, and
softly veers away from walls BEFORE reaching them — no scripted turns.
Architecture: motionRoot (Group) owns world position + heading + bank; the visual rig plays
in-place body clips inside it, so navigation never fights the skeleton and the controller is
the sole heading authority (clips carry no root motion — verified). Fuller clip set exported
(idle/cruise/fast/turn{L,R}{in,loop,out}/eat*, build-clips.mjs). Authored clips play at their
own timing; only cruise cadence scales with speed. Debug panel: cruise speed + roam W/H/DEPTH
+ liveliness, a live readout (mode/clip/speed/turn/pos), and the raw-clip preview.
Next (Codex step 3): needs-driven personality — forage/zoomies/surface/inspect — on this base.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -14,13 +14,15 @@ const root = doc.getRoot();
|
||||
const buffer = root.listBuffers()[0];
|
||||
const meta = JSON.parse(fs.readFileSync(new URL('./angelfish-clips.json', import.meta.url))).clips;
|
||||
|
||||
// output-clip-name -> source clip in the pack
|
||||
// output-clip-name -> source clip in the pack. Full turn SEQUENCES (in→loop→out) so the
|
||||
// controller can play a real turn; swim intensities for cadence/zoomies; eats for forage.
|
||||
const MAP = {
|
||||
idle: 'Idle',
|
||||
cruise: 'Swim1_norm',
|
||||
burst: 'Swim2_Fast',
|
||||
turnL: 'Turn_L_loop',
|
||||
turnR: 'Turn_R_loop',
|
||||
idle: 'Idle',
|
||||
cruise: 'Swim1_norm',
|
||||
fast: 'Swim2_Fast',
|
||||
turnLin: 'Turn_L_in', turnLloop: 'Turn_L_loop', turnLout: 'Turn_L_out',
|
||||
turnRin: 'Turn_R_in', turnRloop: 'Turn_R_loop', turnRout: 'Turn_R_out',
|
||||
eatswim: 'Eat_Swim', eatground: 'Eat_Ground',
|
||||
};
|
||||
|
||||
const src = root.listAnimations()[0];
|
||||
|
||||
Reference in New Issue
Block a user