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;