From 559e8f2cc72a4eb48d2f9b14374b3d625208d64e Mon Sep 17 00:00:00 2001 From: Kevin Levron Date: Fri, 30 Apr 2021 18:37:05 +0200 Subject: [PATCH] add visible prop to object3d --- src/core/Object3D.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/Object3D.ts b/src/core/Object3D.ts index d6be10c..1d274e0 100644 --- a/src/core/Object3D.ts +++ b/src/core/Object3D.ts @@ -50,8 +50,9 @@ export default defineComponent({ rotation: { type: Object as PropType, default: () => ({ x: 0, y: 0, z: 0 }) }, scale: { type: Object as PropType, default: () => ({ x: 1, y: 1, z: 1, order: 'XYZ' }) }, lookAt: { type: Object as PropType, default: null }, - autoRemove: { type: Boolean, default: true }, userData: { type: Object, default: () => ({}) }, + visible: { type: Boolean, default: true }, + autoRemove: { type: Boolean, default: true }, }, setup(): Object3DSetupInterface { // return object3DSetup() @@ -78,6 +79,7 @@ export default defineComponent({ bindProp(this, 'rotation', o3d) bindProp(this, 'scale', o3d) bindProp(this, 'userData', o3d.userData) + bindProp(this, 'visible', o3d) if (this.lookAt) o3d.lookAt(this.lookAt.x ?? 0, this.lookAt.y, this.lookAt.z) watch(() => this.lookAt, (v) => { o3d.lookAt(v.x ?? 0, v.y, v.z) }, { deep: true })