Repository navigation
Scene: BufferAttribute.copyAt, as three.js has it - #129
Merged
Merged
Conversation
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.
three.js's
BufferAttribute.copyAt(index1, attribute, index2)copies one item's raw components from another attribute, using each attribute'sitemSizefor the offsets (r187BufferAttribute.js#L237-L250).packages/scenedoesn't have it, so three.js code that calls it throwscopyAt is not a function.Change:
BufferAttribute.copyAtingeometry.ts, the same loop. Like three.js it copies stored values without normalization and doesn't bumpversion.Adds one method.
Test: one
node:testcase in a new file,packages/scene/test/three-compat-attribute.test.ts: two copies into a normalizedUint8Arrayattribute land atitemSizeoffsets, the method is chainable, andversionstays 0.The test is in its own file so it merges independently of the other open three.js-parity PRs.
Tier T (
packages/sceneTypeScript; no kernel, IR or export changes).Merge gate
npm run typecheck: pass, with main 1b1aa13 merged in.npm test: 175 tests, 174 pass, 0 fail, 1 skipped. The skip is the physics arena test intools/three/test/physics.test.ts, which needs a builtphysics_scene.wasm; main skips it too (174 tests, 173 pass).TypeError: destination.copyAt is not a function). At the head it passes.three@0.187.0, passes unchanged.npm test(187 tests, 186 pass, 0 fail, 1 skipped).npm run test:render: not run, because no idle GPU was available.packages/sceneis in scope, so please run it before merging.Runs were on a Linux VM (Node 24.22.1) in a fresh home directory, from a fresh clone and
npm ci.