zen: Phase B — UB swims with a behavior engine (wander, cruise/rest/burst, U-turns)
UB is no longer a static in-place loop. New behavior.js owns locomotion: UB wanders a bounded tank, cruises at a chosen speed, drifts to new depths (nose tilts into it), occasionally rests or darts, and banks through smooth U-turns at the edges — the tail beats faster/slower with speed. All clips are in-place, so the engine drives world position + heading and crossfades between the named clips (idle/cruise/burst/turnL/turnR). Multi-clip GLB built via tools/glb-split/build-clips.mjs (5 clips, 8.7MB — orphaned Take accessors explicitly disposed). aquarium.js reworked: clip crossfade + per-frame behavior apply. Tuner (/zen?debug=1) now exposes scale + Behavior (cruise speed / roam width / roam height / liveliness) + the fins section. Reduced-motion calms speed + liveliness. Still admin-gated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -89,14 +89,19 @@
|
||||
<div class="panel">
|
||||
<div class="prow"><strong>UB render tuner</strong><button class="copy" onclick={copyValues}>{copied ? 'copied ✓' : 'copy values'}</button></div>
|
||||
|
||||
<label>yaw <span>{dbg.yaw.toFixed(2)}</span>
|
||||
<input type="range" min="-3.15" max="3.15" step="0.01" bind:value={dbg.yaw} oninput={apply} /></label>
|
||||
<label>pitch <span>{dbg.pitch.toFixed(2)}</span>
|
||||
<input type="range" min="-0.6" max="0.6" step="0.01" bind:value={dbg.pitch} oninput={apply} /></label>
|
||||
<label>scale <span>{dbg.scale.toFixed(2)}</span>
|
||||
<input type="range" min="0.3" max="2.5" step="0.05" bind:value={dbg.scale} oninput={apply} /></label>
|
||||
<label>speed <span>{dbg.speed.toFixed(2)}</span>
|
||||
<input type="range" min="0.2" max="1.5" step="0.05" bind:value={dbg.speed} oninput={apply} /></label>
|
||||
|
||||
<hr />
|
||||
<div class="ph">Behavior</div>
|
||||
<label>cruise speed <span>{dbg.baseSpeed.toFixed(2)}</span>
|
||||
<input type="range" min="0.1" max="0.8" step="0.02" bind:value={dbg.baseSpeed} oninput={apply} /></label>
|
||||
<label>roam width <span>{dbg.boundsX.toFixed(2)}</span>
|
||||
<input type="range" min="0.3" max="2" step="0.05" bind:value={dbg.boundsX} oninput={apply} /></label>
|
||||
<label>roam height <span>{dbg.boundsY.toFixed(2)}</span>
|
||||
<input type="range" min="0" max="1.2" step="0.05" bind:value={dbg.boundsY} oninput={apply} /></label>
|
||||
<label>liveliness <span>{dbg.liveliness.toFixed(2)}</span>
|
||||
<input type="range" min="0" max="2" step="0.1" bind:value={dbg.liveliness} oninput={apply} /></label>
|
||||
|
||||
<hr />
|
||||
<div class="ph">Fins & tail</div>
|
||||
@@ -111,11 +116,7 @@
|
||||
{/if}
|
||||
|
||||
<hr />
|
||||
<label class="chk"><input type="checkbox" bind:checked={dbg.paused} onchange={apply} /> freeze frame</label>
|
||||
{#if dbg.paused}
|
||||
<label>frame <span>{dbg.frame.toFixed(2)}</span>
|
||||
<input type="range" min="0" max="1" step="0.01" bind:value={dbg.frame} oninput={apply} /></label>
|
||||
{/if}
|
||||
<label class="chk"><input type="checkbox" bind:checked={dbg.paused} onchange={apply} /> freeze</label>
|
||||
</div>
|
||||
{/if}
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user