From d4e7ac476f43341f17342dfb72ddf7f07e08c846 Mon Sep 17 00:00:00 2001 From: Kevin Levron Date: Mon, 15 Mar 2021 19:54:55 +0100 Subject: [PATCH] mesh --- src/meshes/Mesh.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/meshes/Mesh.js b/src/meshes/Mesh.js index 55cdf3c..086df15 100644 --- a/src/meshes/Mesh.js +++ b/src/meshes/Mesh.js @@ -42,6 +42,13 @@ export default { this.initObject3D(this.mesh); }, + addGeometryWatchers(props) { + Object.keys(props).forEach(prop => { + watch(() => this[prop], () => { + this.refreshGeometry(); + }); + }); + }, setGeometry(geometry) { this.geometry = geometry; if (this.mesh) this.mesh.geometry = geometry;