diff --git a/js/PointerCamera.js b/js/PointerCamera.js index abebd59..53231c9 100644 --- a/js/PointerCamera.js +++ b/js/PointerCamera.js @@ -41,8 +41,11 @@ var PointerCamera = function() { document.addEventListener('keydown', onKeyDown, false); document.addEventListener('keyup', onKeyUp, false); document.addEventListener('mousedown', onMouseDown, false); + document.addEventListener('touchstart', onMouseDown, false); document.addEventListener('mousemove', onMouseMove, false); + document.addEventListener('touchmove', onMouseMove, false); document.addEventListener('mouseup', onMouseUp, false); + document.addEventListener('touchend', onMouseUp, false); } PointerCamera.prototype = Object.create(THREE.PerspectiveCamera.prototype); PointerCamera.prototype.constructor = PointerCamera; diff --git a/scene/js/main.js b/scene/js/main.js index 333555a..749f31d 100644 --- a/scene/js/main.js +++ b/scene/js/main.js @@ -87,6 +87,7 @@ function init() { window.addEventListener('resize', onWindowResize, false); container.addEventListener('mousedown', click, false); + container.addEventListener('touchstart', click, false); // Load the scene loadScene();