forked from GreggJuanEduardoPH/vue-gl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vgl-mesh.js
30 lines (28 loc) · 1.04 KB
/
vgl-mesh.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { Mesh } from 'three';
import { VglObject3dWithMatarialAndGeometry } from '../mixins';
import { name, names } from '../types';
import { validateName, validateNames } from '../validators';
/**
* A component representing triangular polygon mesh based objects,
* corresponding [THREE.Mesh](https://threejs.org/docs/index.html#api/objects/Mesh).
*
* Properties of [VglObject3d](../core/vgl-object3d) are also available as mixin.
*/
export default {
mixins: [VglObject3dWithMatarialAndGeometry],
props: {
/** Name of the geometry, defining the object's structure. */
geometry: { type: name, validator: validateName },
/**
* A Material name or an array of Material name, defining the object's appearance.
*
* A single material will apply the material to all object's faces meanwhile
* an array of material will apply each material to the matching index object's face
*/
material: { type: names, validator: validateNames },
},
computed: {
/** The THREE.Mesh instance. */
inst: () => new Mesh(),
},
};