1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00

add userData to Object3D

This commit is contained in:
Kevin Levron 2021-04-05 01:14:06 +02:00
parent 8121ed0009
commit f6ed7bac92

View File

@ -11,6 +11,7 @@ export default defineComponent({
scale: { type: Object, default: { x: 1, y: 1, z: 1 } }, scale: { type: Object, default: { x: 1, y: 1, z: 1 } },
lookAt: { type: Object, default: null }, lookAt: { type: Object, default: null },
autoRemove: { type: Boolean, default: true }, autoRemove: { type: Boolean, default: true },
userData: { type: Object, default: () => ({}) },
}, },
// can't use setup because it will not be used in sub components // can't use setup because it will not be used in sub components
// setup() {}, // setup() {},
@ -20,6 +21,7 @@ export default defineComponent({
methods: { methods: {
initObject3D(o3d) { initObject3D(o3d) {
this.o3d = o3d; this.o3d = o3d;
this.o3d.userData = this.userData;
this.$emit('created', this.o3d); this.$emit('created', this.o3d);
bindProp(this, 'position', this.o3d); bindProp(this, 'position', this.o3d);