@rings-webgpu/core 1.0.21 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25052,7 +25052,7 @@ class BoundUtil {
25052
25052
  console.warn("genGSplatBounds: No position data available");
25053
25053
  return bound;
25054
25054
  }
25055
- const matrix = obj.transform.worldMatrix;
25055
+ const matrix = gsplatRenderer.object3D.transform.worldMatrix;
25056
25056
  const point = new Vector3();
25057
25057
  for (let i = 0; i < count; i++) {
25058
25058
  const idx = i * 3;
@@ -41253,7 +41253,7 @@ class PostProcessingComponent extends ComponentBase {
41253
41253
  }
41254
41254
  }
41255
41255
 
41256
- const version = "1.0.20";
41256
+ const version = "1.0.22";
41257
41257
 
41258
41258
  class Engine3D {
41259
41259
  /**
@@ -61582,6 +61582,9 @@ class BoundingVolume {
61582
61582
  _type;
61583
61583
  _data;
61584
61584
  _box;
61585
+ get box() {
61586
+ return this._box;
61587
+ }
61585
61588
  _sphere;
61586
61589
  _matrix;
61587
61590
  constructor(data) {
@@ -62261,17 +62264,33 @@ class TilesRenderer {
62261
62264
  }
62262
62265
  }
62263
62266
  if (!parentTile) {
62264
- const tmpMat = new Matrix4();
62265
- tmpMat.copyFrom(transform);
62266
- tmpMat.rawData[12] = 0;
62267
- tmpMat.rawData[13] = 0;
62268
- tmpMat.rawData[14] = 0;
62267
+ transform.copyFrom(this._upRotationMatrix);
62269
62268
  const position = new Vector3();
62270
62269
  position.copyFrom(boundCenter);
62271
- position.applyMatrix4(tmpMat);
62270
+ position.applyMatrix4(transform);
62271
+ const box = tileObj.cached.boundingVolume.box;
62272
+ const boundCorners = [
62273
+ new Vector3(box.min.x, box.min.y, box.min.z),
62274
+ new Vector3(box.max.x, box.min.y, box.min.z),
62275
+ new Vector3(box.min.x, box.max.y, box.min.z),
62276
+ new Vector3(box.max.x, box.max.y, box.min.z),
62277
+ new Vector3(box.min.x, box.min.y, box.max.z),
62278
+ new Vector3(box.max.x, box.min.y, box.max.z),
62279
+ new Vector3(box.min.x, box.max.y, box.max.z),
62280
+ new Vector3(box.max.x, box.max.y, box.max.z)
62281
+ ];
62282
+ for (const corner of boundCorners) {
62283
+ corner.applyMatrix4(transform);
62284
+ }
62285
+ const newBox = new BoundingBox();
62286
+ boundCorners.forEach((corner) => {
62287
+ newBox.expandByPoint(corner);
62288
+ });
62272
62289
  transform.rawData[12] = -position.x;
62273
62290
  transform.rawData[13] = -position.y;
62274
62291
  transform.rawData[14] = -position.z;
62292
+ const min = newBox.min;
62293
+ transform.rawData[13] -= min.y;
62275
62294
  }
62276
62295
  const worldTransform = new Matrix4();
62277
62296
  worldTransform.copyFrom(transform);
@@ -62384,7 +62403,6 @@ class TilesRenderer {
62384
62403
  const extension = getUrlExtension(uri);
62385
62404
  const fullUrl = url;
62386
62405
  let scene = null;
62387
- const adjustmentTransform = this._upRotationMatrix;
62388
62406
  switch (extension.toLowerCase()) {
62389
62407
  case "b3dm":
62390
62408
  const loader = new FileLoader();
@@ -62393,7 +62411,7 @@ class TilesRenderer {
62393
62411
  },
62394
62412
  onComplete: (e) => {
62395
62413
  }
62396
- }, adjustmentTransform);
62414
+ });
62397
62415
  scene = parser.data;
62398
62416
  break;
62399
62417
  case "i3dm":
@@ -62404,8 +62422,7 @@ class TilesRenderer {
62404
62422
  },
62405
62423
  onComplete: (e) => {
62406
62424
  }
62407
- },
62408
- adjustmentTransform
62425
+ }
62409
62426
  );
62410
62427
  break;
62411
62428
  case "glb":
@@ -62579,10 +62596,10 @@ class TilesRenderer {
62579
62596
  adjustmentTransform.makeRotationAxis(Vector3.Y_AXIS, -Math.PI / 2);
62580
62597
  break;
62581
62598
  case "y":
62582
- adjustmentTransform.makeRotationAxis(Vector3.X_AXIS, Math.PI / 2);
62599
+ adjustmentTransform.identity();
62583
62600
  break;
62584
62601
  case "z":
62585
- adjustmentTransform.identity();
62602
+ adjustmentTransform.makeRotationAxis(Vector3.X_AXIS, -Math.PI / 2);
62586
62603
  break;
62587
62604
  default:
62588
62605
  console.warn(`Unknown gltfUpAxis: ${gltfUpAxis}, using default`);
@@ -62590,10 +62607,6 @@ class TilesRenderer {
62590
62607
  break;
62591
62608
  }
62592
62609
  this._upRotationMatrix = adjustmentTransform;
62593
- const invertMatrix = new Matrix4();
62594
- invertMatrix.copyFrom(adjustmentTransform);
62595
- invertMatrix.invert();
62596
- this._applyLocalTransform(this.group.transform, invertMatrix);
62597
62610
  }
62598
62611
  /**
62599
62612
  * Apply local transform matrix to Transform