render-iki: drive idle/physics through IkiMotion, load the hero model - #69
Open
zeikar wants to merge 6 commits into
Open
render-iki: drive idle/physics through IkiMotion, load the hero model#69zeikar wants to merge 6 commits into
zeikar wants to merge 6 commits into
Conversation
The engine now ships IkiMotion (idle + physics + hair chains behind one update()), ParamAngleZ and the HairSway outputs the hero model uses. Only the two @ikijs entries change in the lockfile's packages section; the wider churn in snapshots is pnpm 11.25 re-resolving optional peers (supports-color under debug, @babel/core under styled-jsx) — the same shape appears when the unchanged manifests are re-resolved, no other package changes version, and the result is a fixed point under --frozen-lockfile.
One pure function decides, per parameter, how the engine's idle writes meet the host's own: head angles are the host target (26° per unit of gaze) plus the idle sway, eyes are the host's outright while a gaze exists, and everything else passes through. 26 rather than the parameters' full 30 leaves room for the sway: under document mouse tracking an off-canvas pointer pins the gaze to ±1, so the parked head is the normal state, and at 30 the sway would rectify into a one-sided twitch there. No host lean on AngleZ — the model's own AngleX→rotate binding already leans into a turn.
The adapter ran its own breath sine and blink curve and wrote gaze straight into the player; the blink rescheduling was also broken (after the first blink it re-armed every frame). It now builds one IkiMotion per loaded model and steps it from a single rAF loop registered before the engine's render loop, so the pose lands in the same frame it is computed. Host gaze (lookAt, mouse) is stored and blended into the sink, so the physics springs read the head the host actually set. The hand-kept paramIds presence set is gone — the engine's store drops unknown ids. load() results are honoured: a superseded load (or a destroy during the fetch) builds nothing. The tests mock only IkiPlayer; IkiMotion and ParameterStore are the real 0.3.0 code, so they double as a contract check on the engine.
…tion The 4 KB texture-less sample exercised nothing the new adapter does; the hero (from iki's playground, 0.9 MB with its palette-quantized atlas) has two hair springs, a 2D face warp and the full standard parameter set, so idle, physics, gaze blending and lip-sync are all visible in the harness.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…passes through The iki auto-rig dropped its ±6° AngleX lean (the crown swung ahead of the face on every turn), so the harness's hero.iki is re-rigged, and the "a host lean would double the rig's" rationale no longer holds — AngleZ still passes through, now because no lean belongs on the turn at all.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
@charivo/render-ikimoves to@ikijs/engine0.3.0 /@ikijs/format0.2.0.IkiMotion(idle → hair physics → chains) stepped from one rAF loop registered before the engine's render loop.lookAt, document mouse tracking) is blended over the idle sway in the sink (motion-blend.ts): head = 26°·gaze + sway, eyes = host wins, AngleZ passes through (the model's own rig already leans into a turn), mouth is host-owned via lip-sync. Physics reads the blended head.paramIdspresence gating is gone (the engine's store drops unknown ids);load()results are honoured (superseded/ destroy during fetch).examples/iki-testloads the Iki hero model (0.9 MB, two hair springs, 2D face warp) instead of the 4 KB sample.render-iki: a pure blend unit test and a jsdom renderer test that mocks onlyIkiPlayer(realIkiMotion/ParameterStore→ doubles as an engine contract check).Why the lockfile churn
Only the two
@ikijsentries change inpackages:; thesnapshots:churn is pnpm 11.25 re-resolving optional peers (supports-colorunderdebug, etc.). Re-resolving the unchanged manifests yields the same shape; no other package changes version;pnpm install --frozen-lockfilepasses.Verification
pnpm install --frozen-lockfile,pnpm verify,pnpm test:coverageall exit 0 — 113 files / 1509 tests (1495 baseline + 14).AngleX = 26.04at full deflection); gaze slam writesHairSwayX/Zevery frame; lip-sync writesParamMouthOpenY(30 writes / 1.5 s, max 1.0) and the open mouth renders.No changeset: both packages are private.