author Yannick Deubel (https://github.com/yandeu)
 *  copyright license https import { AddExistingConfig , BoxConfig , ConeConfig , CylinderConfig , ExtendedObject3D , ExtrudeConfig , GroundConfig , MaterialConfig , PlaneConfig , SphereConfig , TorusConfig } from '@enable3d/common/dist/types' ; import Factories from '@enable3d/common/dist/factories' ; class Shapes { constructor ( private factory , private addExisting ) { } public addPlane ( planeConfig = { } , materialConfig = { } ) { const plane = this . factory . add . plane ( planeConfig , materialConfig ) ; this . addExisting ( plane , planeConfig ) ; return plane ; } public addSphere ( sphereConfig = { } , materialConfig = { } ) { const sphere = this . factory . add . sphere ( sphereConfig , materialConfig ) ; this . addExisting ( sphere , sphereConfig ) ; return sphere ; } public addBox ( boxConfig = { } , materialConfig = { } ) { const box = this . factory . add . box ( boxConfig , materialConfig ) ; this . addExisting ( box , boxConfig ) ; return box ; } public addGround ( groundConfig , materialConfig = { } ) { const ground = this . factory . add . ground ( groundConfig , materialConfig ) ; const config = { ... groundConfig , mass : 0 , collisionFlags : 1 } ; this . addExisting ( ground , config ) ; return ground ; } public addCylinder ( cylinderConfig = { } , materialConfig = { } ) { const cylinder = this . factory . add . cylinder ( cylinderConfig , materialConfig ) ; this . addExisting ( cylinder , cylinderConfig ) ; return cylinder ; } public addCone ( coneConfig = { } , materialConfig = { } ) { const cone = this . factory . add . cone ( coneConfig , materialConfig ) ; this . addExisting ( cone , coneConfig ) ; return cone ; } public addTorus ( torusConfig = { } , materialConfig = { } ) { const torus = this . factory . add . torus ( torusConfig , materialConfig ) ; this . addExisting ( torus , torusConfig ) ; return torus ; } public addExtrude ( extrudeConfig , materialConfig = { } ) { const object = this . factory . add . extrude ( extrudeConfig , materialConfig ) ; object . translateX ( 1 ) ; this . addExisting ( object ) ; return object ; } } export default Shapes ;