1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00
trois/src/materials/BasicMaterial.ts
2021-04-19 00:10:00 +02:00

20 lines
511 B
TypeScript

import { defineComponent } from 'vue'
import { MeshBasicMaterial } from 'three'
import { bindProps, propsValues } from '../tools'
import Material, { wireframeProps } from './Material'
export default defineComponent({
extends: Material,
props: {
...wireframeProps,
},
methods: {
createMaterial() {
const material = new MeshBasicMaterial(propsValues(this.$props))
bindProps(this, Object.keys(wireframeProps), material)
return material
},
},
__hmrId: 'BasicMaterial',
})