浏览代码

calculateTransformBoundingSphere: only use extrema if there are not too many transforms

Alexander Rose 5 年之前
父节点
当前提交
129727d5d1
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/mol-gl/renderable/util.ts

+ 2 - 1
src/mol-gl/renderable/util.ts

@@ -122,7 +122,8 @@ export function calculateTransformBoundingSphere(invariantBoundingSphere: Sphere
 
     const { center, radius, extrema } = invariantBoundingSphere
 
-    if (extrema) {
+    // only use extrema if there are not too many transforms
+    if (extrema && transformCount < 50) {
         for (let i = 0, _i = transformCount; i < _i; ++i) {
             for (const e of extrema) {
                 Vec3.transformMat4Offset(v, e, transform, 0, 0, i * 16)