Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(C3DTFeature): use correct interleaved buffer getter #2326

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(C3DTFeature): use correct interleaved buffer getter
  • Loading branch information
AnthonyGlt committed Jul 4, 2024
commit 6245e18671e2044a7c4b2421f0fe5bc0026fe779
12 changes: 6 additions & 6 deletions src/Core/3DTiles/C3DTFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ class C3DTFeature {
target.min.z = Infinity;

this.groups.forEach((group) => {
const positionIndexStart = group.start * 3;
const positionIndexCount = (group.start + group.count) * 3;
const positionIndexStart = group.start * this.object3d.geometry.attributes.position.itemSize;
const positionIndexCount = (group.start + group.count) * this.object3d.geometry.attributes.position.itemSize;

for (let index = positionIndexStart; index < positionIndexCount; index += 3) {
const x = this.object3d.geometry.attributes.position.array[index];
const y = this.object3d.geometry.attributes.position.array[index + 1];
const z = this.object3d.geometry.attributes.position.array[index + 2];
for (let index = positionIndexStart; index < positionIndexCount; index++) {
const x = this.object3d.geometry.attributes.position.getX(index);
const y = this.object3d.geometry.attributes.position.getY(index);
const z = this.object3d.geometry.attributes.position.getZ(index);

target.max.x = Math.max(x, target.max.x);
target.max.y = Math.max(y, target.max.y);
Expand Down