|
| 1 | +--- |
| 2 | +parent: Core |
| 3 | +grand_parent: Components (API) |
| 4 | +nav_order: 2 |
| 5 | +--- |
| 6 | +# VglObject3d |
| 7 | + |
| 8 | +This is the base mixin component for most object components in VueGL, |
| 9 | +corresponding [THREE.Object3D](https://threejs.org/docs/index.html#api/core/Object3D). |
| 10 | +Object3d components inside a object3d component are added |
| 11 | +as children via THREE.Object3D.prototype.add() method. |
| 12 | + |
| 13 | +VglObject3d components inside default slots are added as children. |
| 14 | + |
| 15 | +## props |
| 16 | + |
| 17 | +- `position` ***vector3*** (*optional*) |
| 18 | + |
| 19 | + The object's local position as a 3D vector. |
| 20 | + |
| 21 | +- `rotation` ***euler*** (*optional*) |
| 22 | + |
| 23 | + The object's local rotation as a euler angle. |
| 24 | + |
| 25 | +- `rotation-quaternion` ***quaternion*** (*optional*) |
| 26 | + |
| 27 | + The object's local rotation as a quaternion (specified in x, y, z, w order). |
| 28 | + Do not use in conjunction with the rotation prop, since they both control the same property |
| 29 | + of the underlying THREE.Object3D object. |
| 30 | + |
| 31 | +- `scale` ***vector3*** (*optional*) |
| 32 | + |
| 33 | + The object's local scale as a 3D vector. |
| 34 | + |
| 35 | +- `cast-shadow` ***boolean*** (*optional*) |
| 36 | + |
| 37 | + Whether the object gets rendered into shadow map. |
| 38 | + |
| 39 | +- `receive-shadow` ***boolean*** (*optional*) |
| 40 | + |
| 41 | + Whether the material receives shadows. |
| 42 | + |
| 43 | +- `name` ***name*** (*optional*) |
| 44 | + |
| 45 | + Optional name of the object. |
| 46 | + |
| 47 | +- `hidden` ***boolean*** (*optional*) |
| 48 | + |
| 49 | + Whether the object is visible. |
| 50 | + |
| 51 | +## computed properties |
| 52 | + |
| 53 | +- `inst` |
| 54 | + |
| 55 | + The THREE.Object3D instance. |
| 56 | +- `parent` |
| 57 | + |
| 58 | + The parent THREE.Object3D instance. |
| 59 | + |
| 60 | + **dependencies:** `vglObject3d` |
| 61 | + |
| 62 | + |
| 63 | +## methods |
| 64 | + |
| 65 | +- `emitAsObject3d()` |
| 66 | + |
| 67 | + Emit an event in the `object3ds` namespace. |
| 68 | + |
0 commit comments