浏览代码

Fix bounding info calculation

Popov72 5 年之前
父节点
当前提交
f936fea758
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/Meshes/thinInstanceMesh.ts

+ 2 - 0
src/Meshes/thinInstanceMesh.ts

@@ -250,8 +250,10 @@ Mesh.prototype.thinInstanceRefreshBoundingInfo = function(forceRefreshParentInfo
     const matrixData = this._thinInstanceDataStorage.matrixData;
 
     if (vectors.length === 0) {
+        const worldMatrix = this.getWorldMatrix();
         for (let v = 0; v < boundingInfo.boundingBox.vectors.length; ++v) {
             vectors.push(boundingInfo.boundingBox.vectors[v].clone());
+            Vector3.TransformCoordinatesToRef(vectors[v], worldMatrix, vectors[v]);
         }
     }