2021-04-04 04:06:41 +08:00
|
|
|
import { defineComponent } from 'vue';
|
2021-03-16 05:20:30 +08:00
|
|
|
import { PlaneGeometry } from 'three';
|
|
|
|
import Geometry from './Geometry.js';
|
|
|
|
|
|
|
|
export const props = {
|
|
|
|
width: { type: Number, default: 1 },
|
|
|
|
height: { type: Number, default: 1 },
|
|
|
|
widthSegments: { type: Number, default: 1 },
|
|
|
|
heightSegments: { type: Number, default: 1 },
|
|
|
|
};
|
|
|
|
|
|
|
|
export function createGeometry(comp) {
|
|
|
|
return new PlaneGeometry(comp.width, comp.height, comp.widthSegments, comp.heightSegments);
|
|
|
|
};
|
|
|
|
|
2021-04-04 04:06:41 +08:00
|
|
|
export default defineComponent({
|
2021-03-16 05:20:30 +08:00
|
|
|
extends: Geometry,
|
|
|
|
props,
|
|
|
|
methods: {
|
|
|
|
createGeometry() {
|
|
|
|
this.geometry = createGeometry(this);
|
|
|
|
},
|
|
|
|
},
|
2021-04-04 04:06:41 +08:00
|
|
|
});
|