Repository navigation
Conversation
… has them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 24, 2026
Scene: three.js parity, batch 3 — Box2, Vector4, Triangle, Frustum, projection matrices, Curves
#265
Open
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.
Depends on #250. This branch is #250's commit plus one more. Review the last commit (
Scene: AnimationMixer and AnimationAction). Once #250 lands, the diff shrinks to that commit.Adds three.js's clip player to the scene package (
packages/scene/src/animation-mixer.ts), ported from r187:AnimationMixer:clipAction(by clip or by name fromroot.animations),existingAction,update,setTime,stopAllAction,uncacheClip/uncacheRoot/uncacheAction,getRoot,timeScale,stats, and theloop/finishedevents.AnimationAction:play/stop/reset,setLoop(LoopOnce,LoopRepeat,LoopPingPong, repetitions),clampWhenFinished,startAt, weights and fades (fadeIn,fadeOut,crossFadeFrom/crossFadeTowith warp), time scale (warp,halt,setDuration,syncWith), and normal and additive blending.PropertyBinding(track-name parsing, finding nodes by name, and.material.*/.materials[i]/.mappaths) andPropertyMixer(weighted accumulation, slerp for quaternions, restore on stop).Why:
mixer = new THREE.AnimationMixer(root); mixer.clipAction(clip).play(); mixer.update(dt)is how three.js code animates doors, lights, props and material fades. With this it runs on ThreeRT scene objects. The writes go throughposition.set/quaternion.set/Color.fromArray, so the binding sees them the same way it sees edits made by hand.Differences from three.js, all forced by ThreeRT's objects:
uuidwhen they have one, and otherwise by a key the mixer assigns. ThreeRT objects have nouuid.matrixWorldNeedsUpdateis not set on objects. ThreeRT's transforms report their own changes, and its objects have no such flag.toArrayreads accept the package'sVector3/Quaternion.toArray(), which return a new array instead of writing into one.AnimationObjectGroup, and the skeleton/morph-target paths. ThreeRT scene objects have no bones or morph targets, and glTF models animate throughGLTFModel.animation.Merge gate: tier T. This adds TypeScript API and changes nothing the renderer draws.
npm run typecheck: passesnpm test: passes, 0 failures. Each scenario in the newpackages/scene/test/three-compat-animation-mixer.test.tsbuilds the same rig (a group, a mesh with a standard material, a child) with ThreeRT and withthreer187, runs the same mixer calls, and requires the written state to be deep-equal at every step: position, quaternion, scale, visible, opacity, colour and the child's position. The scenarios cover repeat/loop events/stop-restore, LoopOnce+clamp, ping-pong with repetitions, running backwards, a warped cross-fade, additive over a half-weight base, setTime/startAt/halt/setDuration/uncache, and track-name parsing. As a mutation check, changing the bool select threshold and the loop-count rounding makes 2 of the 7 tests fail.test:renderwas not run. No engine encoding or scene description changes.Drafted with AI assistance.
🤖 Generated with Claude Code