From 42d3e60ac1eed470dd45db29f70352036059ace9 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Mon, 10 Jan 2022 23:11:15 -0500 Subject: [PATCH] prevent double matrix updates --- src/mesh/object.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesh/object.js b/src/mesh/object.js index e7457c77..2dc8ce6e 100644 --- a/src/mesh/object.js +++ b/src/mesh/object.js @@ -152,12 +152,14 @@ mesh.object = class MeshObject { ); let helper = this._boundsBox = new THREE.Box3Helper(b3, 0x555555); world.add(helper); + return true; } } matrixChanged() { - this.object.updateMatrix(); - this.updateBoundsBox(); + if (!this.updateBoundsBox()) { + this.object.updateMatrix(); + } space.update(); publish.matrix({ id: this.id, matrix: this.object.matrix }); return this;