1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00
This commit is contained in:
Kevin Levron 2021-03-15 19:54:55 +01:00
parent 606dcfa9c9
commit d4e7ac476f

View File

@ -42,6 +42,13 @@ export default {
this.initObject3D(this.mesh); this.initObject3D(this.mesh);
}, },
addGeometryWatchers(props) {
Object.keys(props).forEach(prop => {
watch(() => this[prop], () => {
this.refreshGeometry();
});
});
},
setGeometry(geometry) { setGeometry(geometry) {
this.geometry = geometry; this.geometry = geometry;
if (this.mesh) this.mesh.geometry = geometry; if (this.mesh) this.mesh.geometry = geometry;