Skip to content

Scene: assigning Euler.order updates the object's quaternion, as three.js does - #122

Closed
kvnloo wants to merge 5 commits into
meshy-dev:mainfrom
kvnloo:fix/trt-compat-euler
Closed

kvnloo wants to merge 5 commits into
meshy-dev:mainfrom
kvnloo:fix/trt-compat-euler

Conversation

@kvnloo

@kvnloo kvnloo commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

In three.js, Euler.order is an accessor whose setter calls the change callback (r187 Euler.js#L116-L126), so object.rotation.order = 'YXZ' recomposes object.quaternion. In packages/scene it's a plain field, so after a reorder the quaternion (and what renders) keeps the old order until another component is set.

Change: order is a getter/setter over _order in math.ts; the setter calls _onChange. Internal writes (set, setFromRotationMatrix) use _order, so they still notify once or not at all, as before.

Test: one node:test case in a new file, packages/scene/test/three-compat-euler.test.ts. It checks that assigning object.rotation.order recomposes object.quaternion to three.js's value for the new order and keeps the order. It's in its own file so it merges independently of the other open three.js-parity PRs, which all edit three-compat.test.ts.

Only the reorder path changes.

Tier T (packages/scene TypeScript; no kernel, IR or export changes).

Merge gate

Runs were on a clean Linux box (Node 24.22.1) from a fresh clone.

doodlewind added a commit that referenced this pull request Nov 24, 2026
…e.js does (#209, supersedes #122)

Rebased #122 onto main (Euler gained its weak owner in #205).

Co-authored-by: Kevin Rajan <7121943+kvnloo@users.noreply.github.com>
@doodlewind

Copy link
Copy Markdown
Collaborator

Thanks @kvnloo! Merged as #209: ported onto main's Euler after #205 changed it, with you as co-author. The fork network requires SSH certificates, so I couldn't push the rebase to your branch.

@doodlewind doodlewind closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants