From mixed convetion (_, and camel case) to all camel case

This commit is contained in:
Thomas FORGIONE
2015-08-28 21:34:29 +02:00
parent f136ce833f
commit 74cad3824b
40 changed files with 323 additions and 312 deletions
+10 -10
View File
@@ -294,14 +294,14 @@ L3D.PointerCamera.prototype.update = function(time) {
* @param {Number} time number of milliseconds between the previous and the next frame
*/
L3D.PointerCamera.prototype.linearMotion = function(time) {
var position_direction = L3D.Tools.diff(this.new_position, this.position);
var target_direction = L3D.Tools.diff(this.new_target, this.target);
var positionDirection = L3D.Tools.diff(this.newPosition, this.position);
var targetDirection = L3D.Tools.diff(this.newTarget, this.target);
this.position.add(L3D.Tools.mul(position_direction, 0.05 * time / 20));
this.target.add(L3D.Tools.mul(target_direction, 0.05 * time / 20));
this.position.add(L3D.Tools.mul(positionDirection, 0.05 * time / 20));
this.target.add(L3D.Tools.mul(targetDirection, 0.05 * time / 20));
if (L3D.Tools.norm2(L3D.Tools.diff(this.position, this.new_position)) < 0.01 &&
L3D.Tools.norm2(L3D.Tools.diff(this.target, this.new_target)) < 0.01) {
if (L3D.Tools.norm2(L3D.Tools.diff(this.position, this.newPosition)) < 0.01 &&
L3D.Tools.norm2(L3D.Tools.diff(this.target, this.newTarget)) < 0.01) {
this.moving = false;
this.anglesFromVectors();
}
@@ -461,11 +461,11 @@ L3D.PointerCamera.prototype.move = function(recommendation, toSave) {
this.movingHermite = false;
this.moving = true;
this.new_target = otherCamera.target.clone();
this.new_position = otherCamera.position.clone();
this.newTarget = otherCamera.target.clone();
this.newPosition = otherCamera.position.clone();
var t = [0,1];
var f = [this.position.clone(), this.new_position];
var fp = [L3D.Tools.diff(this.target, this.position), L3D.Tools.diff(this.new_target, this.new_position)];
var f = [this.position.clone(), this.newPosition];
var fp = [L3D.Tools.diff(this.target, this.position), L3D.Tools.diff(this.newTarget, this.newPosition)];
this.hermite = new L3D.Hermite.Polynom(t,f,fp);
this.t = 0;
+9 -9
View File
@@ -9,8 +9,8 @@ L3D.ReplayCamera = function() {
this.position = new THREE.Vector3();
this.target = new THREE.Vector3();
this.new_position = new THREE.Vector3();
this.new_target = new THREE.Vector3();
this.newPosition = new THREE.Vector3();
this.newTarget = new THREE.Vector3();
this.data = arguments[5];
@@ -54,7 +54,7 @@ L3D.ReplayCamera.prototype.update = 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.oldPosition, 1-this.t), L3D.Tools.mul(this.newPosition, this.t));
this.position.copy(tmp);
this.t += 0.1 * time / 20;
@@ -65,9 +65,9 @@ L3D.ReplayCamera.prototype.linearMotion = 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.oldPosition, 1-this.t), L3D.Tools.mul(this.newPosition, this.t));
this.position.copy(tmp);
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.oldTarget, 1-this.t), L3D.Tools.mul(this.newTarget, 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) {
@@ -171,10 +171,10 @@ L3D.ReplayCamera.prototype.move = function(recommendation) {
var otherCamera = recommendation.camera || recommendation;
this.moving = true;
this.old_target = this.target.clone();
this.old_position = this.position.clone();
this.new_target = new THREE.Vector3(otherCamera.target.x, otherCamera.target.y, otherCamera.target.z);
this.new_position = new THREE.Vector3(otherCamera.position.x, otherCamera.position.y, otherCamera.position.z);
this.oldTarget = this.target.clone();
this.oldPosition = this.position.clone();
this.newTarget = new THREE.Vector3(otherCamera.target.x, otherCamera.target.y, otherCamera.target.z);
this.newPosition = new THREE.Vector3(otherCamera.position.x, otherCamera.position.y, otherCamera.position.z);
this.t = 0;
};