Skip to content

Commit 7fcdb9c

Browse files
mvaligurskyMartin Valigursky
andauthored
Fix to culling of non-moving skinned objects (playcanvas#3330)
* Fix to culling of non-moving skinned objects * removing one more reference to _radiusVer Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
1 parent b3be224 commit 7fcdb9c

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/scene/batching/batch.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ class Batch {
5454
this._aabb.add(this.origMeshInstances[i].aabb);
5555
}
5656
this.meshInstance.aabb = this._aabb;
57-
this._aabb._radiusVer = -1;
5857
this.meshInstance._aabbVer = 0;
5958
}
6059
}

src/scene/mesh-instance.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -521,14 +521,8 @@ class MeshInstance {
521521
return this.isVisibleFunc(camera);
522522
}
523523

524-
var pos = this.aabb.center;
525-
if (this._aabb._radiusVer !== this._aabbVer) {
526-
this._aabb._radius = this._aabb.halfExtents.length();
527-
this._aabb._radiusVer = this._aabbVer;
528-
}
529-
530-
_tempSphere.radius = this._aabb._radius;
531-
_tempSphere.center = pos;
524+
_tempSphere.center = this.aabb.center; // this line evaluates aabb
525+
_tempSphere.radius = this._aabb.halfExtents.length();
532526

533527
return camera.frustum.containsSphere(_tempSphere);
534528
}

0 commit comments

Comments
 (0)