This commit is contained in:
parent
ce4eee3c44
commit
7e52e1ec08
|
@ -9,11 +9,12 @@ BD.Private.sendData = function(url, data) {
|
||||||
xhr.open("POST", url, true);
|
xhr.open("POST", url, true);
|
||||||
xhr.setRequestHeader("Content-type", "application/json;charset=UTF-8");
|
xhr.setRequestHeader("Content-type", "application/json;charset=UTF-8");
|
||||||
|
|
||||||
xhr.onreadystatechange = function() {
|
// xhr.onreadystatechange = function() {
|
||||||
if(xhr.readyState == 4 && xhr.status == 200) {
|
// if(xhr.readyState == 4 && xhr.status == 200) {
|
||||||
console.log(xhr.responseText);
|
// console.log(xhr.responseText);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
xhr.send(JSON.stringify(data));
|
xhr.send(JSON.stringify(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ PointerCamera.prototype.hermiteMotion = function(time) {
|
||||||
this.target = Tools.sum(this.position, this.hermiteAngles.eval(this.t));
|
this.target = Tools.sum(this.position, this.hermiteAngles.eval(this.t));
|
||||||
|
|
||||||
this.t += 0.01 * time / 20;
|
this.t += 0.01 * time / 20;
|
||||||
|
fayt
|
||||||
if (this.t > 1) {
|
if (this.t > 1) {
|
||||||
this.movingHermite = false;
|
this.movingHermite = false;
|
||||||
this.anglesFromVectors();
|
this.anglesFromVectors();
|
||||||
|
|
|
@ -44,7 +44,7 @@ ReplayCamera.prototype.look = function() {
|
||||||
ReplayCamera.prototype.update = function(time) {
|
ReplayCamera.prototype.update = function(time) {
|
||||||
if (this.started) {
|
if (this.started) {
|
||||||
if (this.event.type == 'camera') {
|
if (this.event.type == 'camera') {
|
||||||
this.linearMotion(time);
|
this.cameraMotion(time);
|
||||||
} else if (this.event.type == 'previousnext') {
|
} else if (this.event.type == 'previousnext') {
|
||||||
this.linearMotion(time / 5);
|
this.linearMotion(time / 5);
|
||||||
} else if (this.event.type == 'arrow') {
|
} else if (this.event.type == 'arrow') {
|
||||||
|
@ -62,7 +62,6 @@ ReplayCamera.prototype.linearMotion = function(time) {
|
||||||
this.position.x = tmp.x;
|
this.position.x = tmp.x;
|
||||||
this.position.y = tmp.y;
|
this.position.y = tmp.y;
|
||||||
this.position.z = tmp.z;
|
this.position.z = tmp.z;
|
||||||
this.target = Tools.sum(Tools.mul(this.old_target, 1-this.t), Tools.mul(this.new_target, this.t));
|
|
||||||
this.t += 0.1 * time / 20;
|
this.t += 0.1 * time / 20;
|
||||||
|
|
||||||
if (this.t > 1) {
|
if (this.t > 1) {
|
||||||
|
@ -70,6 +69,20 @@ ReplayCamera.prototype.linearMotion = function(time) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReplayCamera.prototype.cameraMotion = function(time) {
|
||||||
|
|
||||||
|
var tmp = Tools.sum(Tools.mul(this.old_position, 1-this.t), Tools.mul(this.new_position, this.t));
|
||||||
|
this.position.x = tmp.x;
|
||||||
|
this.position.y = tmp.y;
|
||||||
|
this.position.z = tmp.z;
|
||||||
|
this.target = Tools.sum(Tools.mul(this.old_target, 1-this.t), Tools.mul(this.new_target, this.t));
|
||||||
|
this.t += 1 / (((new Date(this.path[this.counter].time)).getTime() - (new Date(this.path[this.counter-1].time)).getTime()) / 20);
|
||||||
|
|
||||||
|
if (this.t > 1) {
|
||||||
|
this.nextEvent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ReplayCamera.prototype.hermiteMotion = function(time) {
|
ReplayCamera.prototype.hermiteMotion = function(time) {
|
||||||
var eval = this.hermitePosition.eval(this.t);
|
var eval = this.hermitePosition.eval(this.t);
|
||||||
this.position.x = eval.x;
|
this.position.x = eval.x;
|
||||||
|
|
Loading…
Reference in New Issue