1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 12:22:03 +08:00
trois/src/geometries/PlaneGeometry.ts
2021-04-18 22:25:24 +02:00

16 lines
514 B
TypeScript

import { geometryComponent } from './Geometry'
import { PlaneGeometry } from 'three'
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: any): PlaneGeometry {
return new PlaneGeometry(comp.width, comp.height, comp.widthSegments, comp.heightSegments)
}
export default geometryComponent('PlaneGeometry', props, createGeometry)