class Polygon { constructor (x, y, z, geometry, material, visibility, init) { this.x = x; this.y = y; this.z = z; this.shape = new THREE.Mesh(geometry, material); this.visibility = visibility; init.call(this); } } const objects = { hasLoaded: (object) => object.shape != undefined, polygonModels: { ground: new Polygon(0, 0, 0, new THREE.PlaneGeometry(100, 100, 1), materials.ground, true, function (this) { this.shape.rotateX(Math.PI / 2); this.shape.translateX(-1); }), testCube: new Polygon(10, 10, 10, new THREE.BoxGeometry(1, 1, 1), materials.noahTaylor, true, null), }, ...