2021-04-19 04:25:24 +08:00
|
|
|
import { geometryComponent } from './Geometry'
|
2021-04-16 10:13:00 +08:00
|
|
|
import { PlaneGeometry } from 'three'
|
2021-03-16 05:20:30 +08:00
|
|
|
|
|
|
|
export const props = {
|
|
|
|
width: { type: Number, default: 1 },
|
|
|
|
height: { type: Number, default: 1 },
|
|
|
|
widthSegments: { type: Number, default: 1 },
|
|
|
|
heightSegments: { type: Number, default: 1 },
|
2021-04-16 10:13:00 +08:00
|
|
|
}
|
2021-03-16 05:20:30 +08:00
|
|
|
|
2021-04-16 10:13:00 +08:00
|
|
|
export function createGeometry(comp: any): PlaneGeometry {
|
|
|
|
return new PlaneGeometry(comp.width, comp.height, comp.widthSegments, comp.heightSegments)
|
|
|
|
}
|
2021-03-16 05:20:30 +08:00
|
|
|
|
2021-04-16 10:13:00 +08:00
|
|
|
export default geometryComponent('PlaneGeometry', props, createGeometry)
|