Browse Source

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

Alexander Rose 5 năm trước cách đây
mục cha
commit
129727d5d1
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  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)