add vrcontrols definition

This commit is contained in:
Toshiya Nakakura
2015-07-07 14:38:02 +09:00
committed by Toshiya Nakakura
parent 304a251979
commit 17894fdec8
3 changed files with 39 additions and 0 deletions
@@ -0,0 +1,18 @@
/// <reference path="../../../three.d.ts" />
/// <reference path="../../../three-vrcontrols.d.ts" />
var _vrControls = new THREE.VRControls(new THREE.Camera());
_vrControls.update();
_vrControls.scale = 25;
window.addEventListener("keydown", (ev) => {
if (ev.keyCode == "R".charCodeAt(0)) {
_vrControls.zeroSensor();
}
});
window.addEventListener("touchstart", (ev) => {
_vrControls.zeroSensor();
});