From 85d220f4f88202dd775e751ef559345059193319 Mon Sep 17 00:00:00 2001 From: Kevin Levron Date: Mon, 15 Mar 2021 19:13:55 +0100 Subject: [PATCH] improve liquid plane --- src/components/liquid/LiquidPlane.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/liquid/LiquidPlane.js b/src/components/liquid/LiquidPlane.js index dcfd14d..f9caa30 100644 --- a/src/components/liquid/LiquidPlane.js +++ b/src/components/liquid/LiquidPlane.js @@ -19,7 +19,7 @@ export default { this.liquidEffect = new LiquidEffect(this.three.renderer); this.rendererComponent.onMounted(() => { this.liquidEffect.renderer = this.rendererComponent.renderer; - this.three.onBeforeRender(this.liquidEffect.update); + this.three.onBeforeRender(this.update); }); this.material = new MeshStandardMaterial({ color: this.color, side: DoubleSide, metalness: this.metalness, roughness: this.roughness, @@ -44,6 +44,11 @@ export default { this.initObject3D(this.mesh); }, unmounted() { - this.three.offBeforeRender(this.liquidEffect.update); + this.three.offBeforeRender(this.update); + }, + methods: { + update() { + this.liquidEffect.update(); + }, }, };