1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00

Merge pull request #120 from xewl/master

Add missing SphereGeometry parameters
This commit is contained in:
Kevin LEVRON 2022-01-22 10:02:26 +01:00 committed by GitHub
commit da6396ccfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,10 +5,14 @@ export const props = {
radius: { type: Number, default: 1 }, radius: { type: Number, default: 1 },
widthSegments: { type: Number, default: 12 }, widthSegments: { type: Number, default: 12 },
heightSegments: { type: Number, default: 12 }, heightSegments: { type: Number, default: 12 },
phiStart: { type: Number, default: 0 },
phiLength: { type: Number, default: Math.PI * 2 },
thetaStart: { type: Number, default: 0 },
thetaLength: { type: Number, default: Math.PI },
} as const } as const
export function createGeometry(comp: any): SphereGeometry { export function createGeometry(comp: any): SphereGeometry {
return new SphereGeometry(comp.radius, comp.widthSegments, comp.heightSegments) return new SphereGeometry(comp.radius, comp.widthSegments, comp.heightSegments, comp.phiStart, comp.phiLength, comp.thetaStart, comp.thetaLength)
} }
export default geometryComponent('SphereGeometry', props, createGeometry) export default geometryComponent('SphereGeometry', props, createGeometry)