A little cleaning

This commit is contained in:
Thomas FORGIONE 2015-05-22 14:21:11 +02:00
parent 74eda889be
commit fe34290802
3 changed files with 10 additions and 18 deletions

View File

@ -21,11 +21,11 @@ var Info = function(id, finishAction) {
pg.connect(pgc.url, function(err, client, release) { pg.connect(pgc.url, function(err, client, release) {
self.client = client; self.client = client;
self.release = release; self.release = release;
self.loadAll(); self.execute();
}); });
} }
Info.prototype.loadAll = function() { Info.prototype.execute = function() {
this.loadCameras(); this.loadCameras();
this.loadCoins(); this.loadCoins();
this.loadArrows(); this.loadArrows();

View File

@ -380,10 +380,6 @@ PointerCamera.prototype.redoable = function() {
return this.history.redoable(); return this.history.redoable();
} }
// Static members
PointerCamera.DISTANCE_X = 1000;
PointerCamera.DISTANCE_Z = 300;
var History = function() { var History = function() {
this.states = new Array(); this.states = new Array();
this.index = -1; this.index = -1;

View File

@ -1,15 +1,11 @@
var Tools = {version : "1.0" }; var Tools = {version : "1.0" };
Tools.sum = function(v1, v2) { Tools.sum = function(v1, v2) {
var ret = v1.clone(); return new THREE.Vector3(v1.x + v2.x, v1.y + v2.y, v1.z + v2.z);
ret.add(v2);
return ret;
} }
Tools.diff = function(v1, v2) { Tools.diff = function(v1, v2) {
var ret = v1.clone(); return new THREE.Vector3(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z);
ret.sub(v2);
return ret;
} }
Tools.dot = function(v1, v2) { Tools.dot = function(v1, v2) {
@ -17,15 +13,15 @@ Tools.dot = function(v1, v2) {
} }
Tools.cross = function(v1, v2) { Tools.cross = function(v1, v2) {
var ret = v1.clone(); return new THREE.Vector3(
ret.cross(v2); v1.y * v2.z - v1.z * v2.y,
return ret; v1.z * v2.x - v1.x * v2.z,
v1.x * v2.y - v1.y * v2.x
);
} }
Tools.mul = function(v1, lambda) { Tools.mul = function(v1, lambda) {
var ret = v1.clone(); return new THREE.Vector3(v1.x * lambda, v1.y * lambda, v1.z * lambda);
ret.multiplyScalar(lambda);
return ret;
} }
Tools.equals = function(v1, v2) { Tools.equals = function(v1, v2) {