1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-27 22:12:01 +08:00

add created event (wip)

This commit is contained in:
Kevin Levron 2021-03-20 21:05:27 +01:00
parent c3bd29db0a
commit f90cb8d6f8

View File

@ -4,7 +4,7 @@ import { bindProp } from '../tools.js';
export default { export default {
name: 'Object3D', name: 'Object3D',
inject: ['three', 'scene', 'rendererComponent'], inject: ['three', 'scene', 'rendererComponent'],
emits: ['ready'], emits: ['created', 'ready'],
props: { props: {
position: { type: Object, default: { x: 0, y: 0, z: 0 } }, position: { type: Object, default: { x: 0, y: 0, z: 0 } },
rotation: { type: Object, default: { x: 0, y: 0, z: 0 } }, rotation: { type: Object, default: { x: 0, y: 0, z: 0 } },
@ -19,6 +19,7 @@ export default {
methods: { methods: {
initObject3D(o3d) { initObject3D(o3d) {
this.o3d = o3d; this.o3d = o3d;
this.$emit('created', this.o3d);
bindProp(this, 'position', this.o3d); bindProp(this, 'position', this.o3d);
bindProp(this, 'rotation', this.o3d); bindProp(this, 'rotation', this.o3d);