1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 12:22:03 +08:00
trois/src/materials/BasicMaterial.ts

20 lines
511 B
TypeScript
Raw Normal View History

2021-04-19 06:10:00 +08:00
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',
})