2021-04-05 02:42:35 +08:00
|
|
|
import { defineComponent } from 'vue';
|
2020-09-14 22:57:11 +08:00
|
|
|
import { MeshLambertMaterial } from 'three';
|
2021-03-25 21:24:30 +08:00
|
|
|
import { bindProps, propsValues } from '../tools';
|
2021-03-13 23:41:01 +08:00
|
|
|
import Material, { wireframeProps } from './Material';
|
2020-09-14 22:57:11 +08:00
|
|
|
|
2021-04-05 02:42:35 +08:00
|
|
|
export default defineComponent({
|
2020-09-14 22:57:11 +08:00
|
|
|
extends: Material,
|
2021-03-13 23:41:01 +08:00
|
|
|
props: {
|
|
|
|
...wireframeProps,
|
|
|
|
},
|
2020-10-03 18:34:14 +08:00
|
|
|
methods: {
|
|
|
|
createMaterial() {
|
2021-03-07 06:14:22 +08:00
|
|
|
this.material = new MeshLambertMaterial(propsValues(this.$props));
|
2020-10-03 18:34:14 +08:00
|
|
|
},
|
2021-03-13 23:41:01 +08:00
|
|
|
addWatchers() {
|
|
|
|
bindProps(this, Object.keys(wireframeProps), this.material);
|
|
|
|
},
|
2020-09-14 22:57:11 +08:00
|
|
|
},
|
2020-09-19 23:00:29 +08:00
|
|
|
__hmrId: 'LambertMaterial',
|
2021-04-05 02:42:35 +08:00
|
|
|
});
|