Cleaned a little
This commit is contained in:
parent
d4332f27fb
commit
6dc9faf493
|
@ -19,10 +19,7 @@ L3D.FixedCamera = function(arg1, arg2, arg3, arg4, position, target) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.position.x = position.x;
|
this.position.copy(position);
|
||||||
this.position.y = position.y;
|
|
||||||
this.position.z = position.z;
|
|
||||||
|
|
||||||
this.target = target.clone();
|
this.target = target.clone();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -59,9 +59,7 @@ L3D.ReplayCamera.prototype.update = function(time) {
|
||||||
|
|
||||||
L3D.ReplayCamera.prototype.linearMotion = function(time) {
|
L3D.ReplayCamera.prototype.linearMotion = function(time) {
|
||||||
var tmp = L3D.Tools.sum(L3D.Tools.mul(this.old_position, 1-this.t), L3D.Tools.mul(this.new_position, this.t));
|
var tmp = L3D.Tools.sum(L3D.Tools.mul(this.old_position, 1-this.t), L3D.Tools.mul(this.new_position, this.t));
|
||||||
this.position.x = tmp.x;
|
this.position.copy(tmp);
|
||||||
this.position.y = tmp.y;
|
|
||||||
this.position.z = tmp.z;
|
|
||||||
this.t += 0.1 * time / 20;
|
this.t += 0.1 * time / 20;
|
||||||
|
|
||||||
if (this.t > 1) {
|
if (this.t > 1) {
|
||||||
|
@ -72,9 +70,7 @@ L3D.ReplayCamera.prototype.linearMotion = function(time) {
|
||||||
L3D.ReplayCamera.prototype.cameraMotion = function(time) {
|
L3D.ReplayCamera.prototype.cameraMotion = function(time) {
|
||||||
|
|
||||||
var tmp = L3D.Tools.sum(L3D.Tools.mul(this.old_position, 1-this.t), L3D.Tools.mul(this.new_position, this.t));
|
var tmp = L3D.Tools.sum(L3D.Tools.mul(this.old_position, 1-this.t), L3D.Tools.mul(this.new_position, this.t));
|
||||||
this.position.x = tmp.x;
|
this.position.copy(tmp);
|
||||||
this.position.y = tmp.y;
|
|
||||||
this.position.z = tmp.z;
|
|
||||||
this.target = L3D.Tools.sum(L3D.Tools.mul(this.old_target, 1-this.t), L3D.Tools.mul(this.new_target, this.t));
|
this.target = L3D.Tools.sum(L3D.Tools.mul(this.old_target, 1-this.t), L3D.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);
|
this.t += 1 / (((new Date(this.path[this.counter].time)).getTime() - (new Date(this.path[this.counter-1].time)).getTime()) / 20);
|
||||||
|
|
||||||
|
@ -85,9 +81,7 @@ L3D.ReplayCamera.prototype.cameraMotion = function(time) {
|
||||||
|
|
||||||
L3D.ReplayCamera.prototype.hermiteMotion = function(time) {
|
L3D.ReplayCamera.prototype.hermiteMotion = function(time) {
|
||||||
var e = this.hermitePosition.eval(this.t);
|
var e = this.hermitePosition.eval(this.t);
|
||||||
this.position.x = e.x;
|
this.position.copy(tmp);
|
||||||
this.position.y = e.y;
|
|
||||||
this.position.z = e.z;
|
|
||||||
|
|
||||||
this.target = L3D.Tools.sum(this.position, this.hermiteAngles.eval(this.t));
|
this.target = L3D.Tools.sum(this.position, this.hermiteAngles.eval(this.t));
|
||||||
|
|
||||||
|
|
|
@ -7,15 +7,6 @@
|
||||||
L3D.ViewportRecommendation = function(arg1, arg2, arg3, arg4, position, target) {
|
L3D.ViewportRecommendation = function(arg1, arg2, arg3, arg4, position, target) {
|
||||||
L3D.BaseRecommendation.apply(this, arguments);
|
L3D.BaseRecommendation.apply(this, arguments);
|
||||||
|
|
||||||
// Set Position
|
|
||||||
if (position === undefined) {
|
|
||||||
this.camera.position = new THREE.Vector3(0,0,5);
|
|
||||||
} else {
|
|
||||||
this.camera.position.x = position.x;
|
|
||||||
this.camera.position.y = position.y;
|
|
||||||
this.camera.position.z = position.z;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (target === undefined)
|
if (target === undefined)
|
||||||
target = new THREE.Vector3(0,0,0);
|
target = new THREE.Vector3(0,0,0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue