Corrected bugs, and prepare for tutorial

This commit is contained in:
Thomas FORGIONE
2015-07-22 14:48:14 +02:00
parent 9b319f3c33
commit 3c59dce3a6
11 changed files with 95 additions and 26 deletions

View File

@@ -248,16 +248,19 @@ L3D.PointerCamera.prototype.onPointerLockChange = function() {
} else {
this.pointerLocked = false;
this.mousePointer.clear();
if (this.mousePointer)
this.mousePointer.clear();
this.mouseMove.x = 0;
this.mouseMove.y = 0;
// Draw start canvas only if should lock
if (this.shouldLock)
this.startCanvas.render();
else
this.startCanvas.clear();
if (this.startCanvas) {
if (this.shouldLock)
this.startCanvas.render();
else
this.startCanvas.clear();
}
event.locked = false;
@@ -275,14 +278,14 @@ L3D.PointerCamera.prototype.onPointerLockChange = function() {
* @param {Number} time number of milliseconds between the previous and the next frame
*/
L3D.PointerCamera.prototype.update = function(time) {
this.shouldLogCameraAngles = false;
if (this.moving) {
this.shouldLogCameraAngles = false;
this.linearMotion(time);
} else if (this.movingHermite) {
this.shouldLogCameraAngles = false;
this.hermiteMotion(time);
} else {
this.shouldLogCameraAngles = true;
this.normalMotion(time);
}
};

View File

@@ -94,6 +94,7 @@ L3D.ReplayCamera.prototype.nextEvent = function() {
// Finished
if (this.counter >= this.path.length) {
this.started = false;
console.log('The replay is finished');
return;
}