Browse Source

Applied implicit naming convention. BTW does it exist a naming convention?
Fixed script dependencies

Gwenaël Hagenmuller 11 years ago
parent
commit
1c22736518

+ 2 - 2
Babylon/Cameras/Controllers/babylon.gravityInputController.js

@@ -4,12 +4,12 @@ var BABYLON = BABYLON || {};
 
 (function () {
     BABYLON.GravityInputController = function (scene, target) {
-        BABYLON.inputController.call(this, scene, target);
+        BABYLON.InputController.call(this, scene, target);
         this._moveVectorGlobal = new BABYLON.Vector3(0, 0, 0);
         this._moveVectorLocal = new BABYLON.Vector3(0, 0, 0);
         this._fallSpeed = .6;
     };
-    BABYLON.GravityInputController.prototype = Object.create(BABYLON.inputController.prototype);
+    BABYLON.GravityInputController.prototype = Object.create(BABYLON.InputController.prototype);
     BABYLON.GravityInputController.prototype.update = function () {
         this._moveVectorGlobal.x = 0;
         this._moveVectorGlobal.y = -this._fallSpeed * BABYLON.Tools.GetDeltaTime() / 1000.0;

+ 22 - 22
Babylon/Cameras/Controllers/babylon.inputController.js

@@ -4,28 +4,28 @@ var BABYLON = BABYLON || {};
 
 (function () {
 
-	BABYLON.inputControllerTarget = function () {
+	BABYLON.InputControllerTarget = function () {
 		this._position = new BABYLON.Vector3(0, 0, 0);
 		this._orientation = { yaw: 0.0, pitch: 0.0, roll: 0.0 };
 	};
 
-	BABYLON.inputControllerTarget.prototype.getPosition = function () {
+	BABYLON.InputControllerTarget.prototype.getPosition = function () {
 		return this._position;
 	};
-	BABYLON.inputControllerTarget.prototype.getOrientation = function () {
+	BABYLON.InputControllerTarget.prototype.getOrientation = function () {
 		return this._orientation;
 	};
-	BABYLON.inputControllerTarget.prototype.moveRelative = function (movementVector) {
+	BABYLON.InputControllerTarget.prototype.moveRelative = function (movementVector) {
 
 	};
 	
-	BABYLON.inputControllerTarget.prototype.rotateRelative = function (relativeOrientation) {
+	BABYLON.InputControllerTarget.prototype.rotateRelative = function (relativeOrientation) {
 
 	};
-	BABYLON.inputControllerTarget.prototype.getOrientationMatrix = function () { return new BABYLON.Matrix(); };
-	BABYLON.inputControllerTarget.prototype.getInvertOrientationMatrix = function () { return new BABYLON.Matrix(); };
+	BABYLON.InputControllerTarget.prototype.getOrientationMatrix = function () { return new BABYLON.Matrix(); };
+	BABYLON.InputControllerTarget.prototype.getInvertOrientationMatrix = function () { return new BABYLON.Matrix(); };
 
-	BABYLON.inputControllerMultiTarget = function (targets) {
+	BABYLON.InputControllerMultiTarget = function (targets) {
 	    this.targets = targets;
 	    var mainTarget = this.targets[0];
 	    if (!mainTarget.controllers) {
@@ -35,30 +35,30 @@ var BABYLON = BABYLON || {};
 	    }
 	};
 
-	BABYLON.inputControllerMultiTarget.prototype.getPosition = function () {
+	BABYLON.InputControllerMultiTarget.prototype.getPosition = function () {
 		return this.targets[0].getPosition();
 	};
-	BABYLON.inputControllerMultiTarget.prototype.getOrientation = function () {
+	BABYLON.InputControllerMultiTarget.prototype.getOrientation = function () {
 		return this.targets[0].getOrientation();
 	};
 
 
-	BABYLON.inputControllerMultiTarget.prototype.getOrientationMatrix = function () { return this.targets[0].getOrientationMatrix(); };
-	BABYLON.inputControllerMultiTarget.prototype.getInvertOrientationMatrix = function () { return this.targets[0].getInvertOrientationMatrix(); };
+	BABYLON.InputControllerMultiTarget.prototype.getOrientationMatrix = function () { return this.targets[0].getOrientationMatrix(); };
+	BABYLON.InputControllerMultiTarget.prototype.getInvertOrientationMatrix = function () { return this.targets[0].getInvertOrientationMatrix(); };
 
-	BABYLON.inputControllerMultiTarget.prototype.moveRelative = function (movementVector) {
+	BABYLON.InputControllerMultiTarget.prototype.moveRelative = function (movementVector) {
 		for (var i = 0; i < this.targets.length; ++i) {
 			this.targets[i].moveRelative(movementVector);
 		}
 	};
 
-	BABYLON.inputControllerMultiTarget.prototype.rotateRelative = function (relativeOrientation) {
+	BABYLON.InputControllerMultiTarget.prototype.rotateRelative = function (relativeOrientation) {
 		for (var i = 0; i < this.targets.length; ++i) {
 			this.targets[i].rotateRelative(relativeOrientation);
 		}
 	};
 
-	BABYLON.inputControllerMultiTarget.prototype.update = function () {
+	BABYLON.InputControllerMultiTarget.prototype.update = function () {
 		if (this.controllers) {
 			for (var i = 0; i < this.controllers.length; ++i) {
 				this.controllers[i].update();
@@ -66,7 +66,7 @@ var BABYLON = BABYLON || {};
 		}
 	};
 	
-	BABYLON.inputController = function (scene, target) {
+	BABYLON.InputController = function (scene, target) {
 		this.scene = scene;
 		this.target = target;
 		if (!this.target.controllers) {
@@ -75,24 +75,24 @@ var BABYLON = BABYLON || {};
 			this.target.controllers.push(this);
 		}
 	};
-	BABYLON.inputController.prototype.attachToCanvas = function (canvas) {
+	BABYLON.InputController.prototype.attachToCanvas = function (canvas) {
 
 	};
-	BABYLON.inputController.prototype.detachFromCanvas = function (canvas) {
+	BABYLON.InputController.prototype.detachFromCanvas = function (canvas) {
 
 	};
-	BABYLON.inputController.prototype.update = function () {
+	BABYLON.InputController.prototype.update = function () {
 
 	};
 
-	BABYLON.inputController.prototype.dispose = function () {
+	BABYLON.InputController.prototype.dispose = function () {
 
 	};
 
 	BABYLON.inputFilter = function (scene, target) {
-	    BABYLON.inputController.call(this, scene, target);
+	    BABYLON.InputController.call(this, scene, target);
 	};
-	BABYLON.inputFilter.prototype = Object.create(BABYLON.inputController.prototype);
+	BABYLON.inputFilter.prototype = Object.create(BABYLON.InputController.prototype);
 	BABYLON.inputFilter.prototype.update = function () {
 	    if (this.controllers) {
 	        for (var i = 0; i < this.controllers.length; ++i) {

+ 7 - 7
Babylon/Cameras/Controllers/babylon.keyboardMoveController.js

@@ -3,8 +3,8 @@
 var BABYLON = BABYLON || {};
 
 (function () {
-	BABYLON.keyboardMoveController = function (scene, target) {
-		BABYLON.inputController.call(this, scene, target);
+	BABYLON.KeyboardMoveController = function (scene, target) {
+		BABYLON.InputController.call(this, scene, target);
 		this._keys = [];
 		this.keysUp = [38];
 		this.keysDown = [40];
@@ -19,8 +19,8 @@ var BABYLON = BABYLON || {};
 		this.maxAbsoluteAcceleration = 5; // 2 meters per second²
 		this._targetSpeed = new BABYLON.Vector3(0, 0, 0);
 	};
-	BABYLON.keyboardMoveController.prototype = Object.create(BABYLON.inputController.prototype);
-	BABYLON.keyboardMoveController.prototype.attachToCanvas = function (canvas) {
+	BABYLON.KeyboardMoveController.prototype = Object.create(BABYLON.InputController.prototype);
+	BABYLON.KeyboardMoveController.prototype.attachToCanvas = function (canvas) {
 		var that = this;
 		this._canvas = canvas;
 
@@ -58,12 +58,12 @@ var BABYLON = BABYLON || {};
 		window.addEventListener("keyup", this._onKeyUp, false);
 		window.addEventListener("blur", this._onLostFocus, false);
 	};
-	BABYLON.keyboardMoveController.prototype.detachFromCanvas = function (canvas) {
+	BABYLON.KeyboardMoveController.prototype.detachFromCanvas = function (canvas) {
 		window.removeEventListener("keydown", this._onKeyDown, false);
 		window.removeEventListener("keyup", this._onKeyUp, false);
 		window.removeEventListener("blur", this._onLostFocus, false);
 	};
-	BABYLON.keyboardMoveController.prototype.updateCurrentSpeed = function () {
+	BABYLON.KeyboardMoveController.prototype.updateCurrentSpeed = function () {
 		this._lastFrameSpeed.x = this._currentSpeed.x;
 		this._lastFrameSpeed.y = this._currentSpeed.y;
 		this._lastFrameSpeed.z = this._currentSpeed.z;
@@ -92,7 +92,7 @@ var BABYLON = BABYLON || {};
 			this._currentSpeed.addInPlace(dv);
 		}
 	};
-	BABYLON.keyboardMoveController.prototype.update = function () {
+	BABYLON.KeyboardMoveController.prototype.update = function () {
 		this._targetSpeed.x = 0;
 		this._targetSpeed.y = 0;
 		this._targetSpeed.z = 0;

+ 2 - 2
Babylon/Cameras/Controllers/babylon.oculusController.js

@@ -4,14 +4,14 @@ var BABYLON = BABYLON || {};
 
 (function () {
     BABYLON.OculusController = function (scene, target) {
-        BABYLON.inputController.call(this, scene, target);
+        BABYLON.InputController.call(this, scene, target);
         this._deviceOrientationHandler = this.onOrientationEvent.bind(this);
         this._tempOrientation = { yaw: 0.0, pitch: 0.0, roll: 0.0 };
         this._relativeOrientation = { yaw: 0.0, pitch: 0.0, roll: 0.0 };
         window.addEventListener("deviceorientation", this._deviceOrientationHandler);
     };
 
-    BABYLON.OculusController.prototype = Object.create(BABYLON.inputController.prototype);
+    BABYLON.OculusController.prototype = Object.create(BABYLON.InputController.prototype);
 
     BABYLON.OculusController.prototype.onOrientationEvent = function (ev) {
         this._tempOrientation.yaw = ev.alpha / 180 * Math.PI;

+ 3 - 3
Babylon/Cameras/babylon.oculusOrientedCamera.js

@@ -59,7 +59,7 @@ var BABYLON = BABYLON || {};
         scene.activeCameras.push(rightCamera);
         leftCamera.attachControl(canvas);
         rightCamera.attachControl(canvas);
-        var multiTarget = new BABYLON.inputControllerMultiTarget([leftCamera, rightCamera]);
+        var multiTarget = new BABYLON.InputControllerMultiTarget([leftCamera, rightCamera]);
         var controller = new BABYLON.OculusController(scene, multiTarget);
         var moveTarget = multiTarget;
         if (!disableCollisions) {
@@ -72,7 +72,7 @@ var BABYLON = BABYLON || {};
             var gravityController = new BABYLON.GravityInputController(scene, moveTarget);
             moveTarget = globalAxisFactorFilter;
         }
-        var moveController = new BABYLON.keyboardMoveController(scene, moveTarget);
+        var moveController = new BABYLON.KeyboardMoveController(scene, moveTarget);
         moveController.attachToCanvas(canvas);
         var result = {
             leftCamera: leftCamera, rightCamera: rightCamera, intermediateControllerTarget: multiTarget,
@@ -140,7 +140,7 @@ var BABYLON = BABYLON || {};
         return this._projectionMatrix;
     };
 
-    // implementation of inputControllerTarget
+    // implementation of InputControllerTarget
     BABYLON.OculusOrientedCamera.prototype.getOrientation = function () {
         return this._currentOrientation;
     };

+ 4 - 4
Tools/BuildOurOwnBabylonJS/BuildOurOwnBabylonJS/babylonJS.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <files xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="babylonJS.xsd">
-  <script src="Babylon/Cameras/Controllers/babylon.inputController.js"></script>
-  <script src="Babylon/PostProcess/babylon.oculusDistortionCorrectionPostProcess.js"></script>
+  <script src="Babylon/Cameras/babylon.virtualJoysticksCamera.js"></script>
   <script src="Babylon/Tools/babylon.virtualJoystick.js"></script>
-  <script src="Babylon/Cameras/Controllers/babylon.oculusController.js"></script>
   <script src="Babylon/Cameras/babylon.oculusOrientedCamera.js"></script>
-  <script src="Babylon/Cameras/babylon.virtualJoysticksCamera.js"></script>
+  <script src="Babylon/PostProcess/babylon.oculusDistortionCorrectionPostProcess.js"></script>
+  <script src="Babylon/Cameras/Controllers/babylon.oculusController.js"></script>
   <script src="Babylon/Cameras/Controllers/babylon.keyboardMoveController.js"></script>
+  <script src="Babylon/Cameras/Controllers/babylon.inputController.js"></script>
   <script src="Babylon/Mesh/babylon.csg.js"></script>
   <script src="Babylon/Tools/babylon.sceneSerializer.js"></script>
   <script src="Babylon/Physics/babylon.physicsEngine.js"></script>

File diff suppressed because it is too large
+ 2 - 2
babylon.1.9.0.js