added pointer locking and viewport moving

This commit is contained in:
Jeena 2014-12-06 20:20:49 +01:00
parent 072e984215
commit 6d9d02615a
12 changed files with 236 additions and 141 deletions

View file

@ -357,6 +357,7 @@ function (ColorConverter, Exception) {
clearInterval(instance.channelDestructionTimeout);
}
requestPointerLock();
}
}
@ -385,6 +386,19 @@ function (ColorConverter, Exception) {
});
}
}
function requestPointerLock() {
var c = $("#canvas");
c.requestPointerLock = c.requestPointerLock ||
c.mozRequestPointerLock ||
c.webkitRequestPointerLock;
// Ask the browser to lock the pointer)
c.requestPointerLock();
}
$("#canvas").onclick = requestPointerLock;
return Menu;