diff --git a/src/js/app/helpers/animation.js b/src/js/app/helpers/animation.js deleted file mode 100644 index 0caaed5..0000000 --- a/src/js/app/helpers/animation.js +++ /dev/null @@ -1,27 +0,0 @@ -import * as THREE from 'three'; - -export default class Animation { - constructor(obj, clip) { - // Scene that the clip will be applied to - this.obj = obj; - - // Initialize animation mixer - this.mixer = new THREE.AnimationMixer(this.obj); - - // Simple animation player - this.playClip(clip); - } - - playClip(clip) { - this.action = this.mixer.clipAction(clip); - - this.action.play(); - } - - // Call update in loop - update(delta) { - if(this.mixer) { - this.mixer.update(delta); - } - } -} diff --git a/src/js/app/helpers/geometry.js b/src/js/app/helpers/geometry.js deleted file mode 100644 index 7814ca1..0000000 --- a/src/js/app/helpers/geometry.js +++ /dev/null @@ -1,42 +0,0 @@ -import * as THREE from 'three'; - -import Material from './material'; - -import Config from '../../data/config'; - -// This helper class can be used to create and then place geometry in the scene -export default class Geometry { - constructor(scene) { - this.scene = scene; - this.geo = null; - } - - make(type) { - if(type === 'plane') { - return (width, height, widthSegments = 1, heightSegments = 1) => { - this.geo = new THREE.PlaneGeometry(width, height, widthSegments, heightSegments); - }; - } - - if(type === 'sphere') { - return (radius, widthSegments = 32, heightSegments = 32) => { - this.geo = new THREE.SphereGeometry(radius, widthSegments, heightSegments); - }; - } - } - - place(position, rotation) { - const material = new Material(0xeeeeee).standard; - const mesh = new THREE.Mesh(this.geo, material); - - // Use ES6 spread to set position and rotation from passed in array - mesh.position.set(...position); - mesh.rotation.set(...rotation); - - if(Config.shadow.enabled) { - mesh.receiveShadow = true; - } - - this.scene.add(mesh); - } -} diff --git a/src/js/app/helpers/material.js b/src/js/app/helpers/material.js deleted file mode 100644 index 3e57d55..0000000 --- a/src/js/app/helpers/material.js +++ /dev/null @@ -1,24 +0,0 @@ -import * as THREE from 'three'; - -import Config from '../../data/config'; - -// USe this class as a helper to set up some default materials -export default class Material { - constructor(color) { - this.basic = new THREE.MeshBasicMaterial({ - color, - side: THREE.DoubleSide - }); - - this.standard = new THREE.MeshStandardMaterial({ - color, - shading: THREE.FlatShading, - roughness: 1, - metalness: 0, - side: THREE.DoubleSide - }); - - this.wire = new THREE.MeshBasicMaterial({wireframe: true}); - } -} -