Browse Source

Merge remote-tracking branch 'remotes/BabylonJS/master' into ourOwnBabylonJS

Gwenaël Hagenmuller 11 years ago
parent
commit
4fa55b458a

+ 4 - 4
Babylon/Cameras/babylon.arcRotateCamera.js

@@ -259,8 +259,8 @@ var BABYLON = BABYLON || {};
         canvas.addEventListener("MSGestureChange", this._onGesture, false);
         window.addEventListener("keydown", this._onKeyDown, false);
         window.addEventListener("keyup", this._onKeyUp, false);
-        window.addEventListener('mousewheel', this._wheel, false); //Chrome, Safari, Opera, IE
-        window.addEventListener('DOMMouseScroll', this._wheel, false); //Firefox
+        window.addEventListener('mousewheel', this._wheel, false);
+        window.addEventListener('DOMMouseScroll', this._wheel, false);
         window.addEventListener("blur", this._onLostFocus, false);
     };
 
@@ -278,8 +278,8 @@ var BABYLON = BABYLON || {};
         canvas.removeEventListener("MSGestureChange", this._onGesture);
         window.removeEventListener("keydown", this._onKeyDown);
         window.removeEventListener("keyup", this._onKeyUp);
-        window.removeEventListener('mousewheel', this._wheel); //Chrome, Safari, Opera, IE
-        window.removeEventListener('DOMMouseScroll', this._wheel); //Firefox
+        window.removeEventListener('mousewheel', this._wheel);
+        window.removeEventListener('DOMMouseScroll', this._wheel);
         window.removeEventListener("blur", this._onLostFocus);
 
         this._MSGestureHandler = null;

+ 3 - 3
Babylon/Mesh/babylon.mesh.js

@@ -305,9 +305,8 @@ var BABYLON = BABYLON || {};
     };
 
     BABYLON.Mesh.prototype._updateBoundingInfo = function () {
-        
         this._boundingInfo = this._boundingInfo || new BABYLON.BoundingInfo(this._absolutePosition, this._absolutePosition);
-        
+
         this._scaleFactor = Math.max(this.scaling.x, this.scaling.y);
         this._scaleFactor = Math.max(this._scaleFactor, this.scaling.z);
 
@@ -321,6 +320,7 @@ var BABYLON = BABYLON || {};
 
             subMesh.updateBoundingInfo(this._worldMatrix, this._scaleFactor);
         }
+
     };
 
     BABYLON.Mesh.prototype.computeWorldMatrix = function (force) {
@@ -836,7 +836,7 @@ var BABYLON = BABYLON || {};
         // Buffers
         result._vertexBuffers = this._vertexBuffers;
         for (var kind in result._vertexBuffers) {
-            result._vertexBuffers[kind].references++;
+            result._vertexBuffers[kind]._buffer.references++;
         }
 
         result._indexBuffer = this._indexBuffer;

+ 1 - 1
Babylon/babylon.engine.js

@@ -111,7 +111,7 @@ var BABYLON = BABYLON || {};
     // Properties
     BABYLON.Engine.prototype.getAspectRatio = function (camera) {
         var viewport = camera.viewport;
-        return (this._renderingCanvas.width * viewport.width) / (this._renderingCanvas.height * viewport.height);;
+        return (this._renderingCanvas.width * viewport.width) / (this._renderingCanvas.height * viewport.height);
     };
 
     BABYLON.Engine.prototype.getRenderWidth = function () {

+ 3 - 5
Exporters/Blender/io_export_babylon.py

@@ -119,16 +119,14 @@ class Export_babylon(bpy.types.Operator, ExportHelper):
         return (matrix.to_3x3() * mathutils.Vector((0.0, 0.0, -1.0))).normalized()
             
     def export_camera(object, scene, file_handler):     
-        invWorld = object.matrix_world.copy()
-        invWorld.invert()
-        
-        target = mathutils.Vector((0, 1, 0)) * invWorld
+        rotation = mathutils.Vector((-object.rotation_euler[0] + math.pi / 2,
+            object.rotation_euler[1], -object.rotation_euler[2]))
     
         file_handler.write("{")
         Export_babylon.write_string(file_handler, "name", object.name, True)        
         Export_babylon.write_string(file_handler, "id", object.name)
         Export_babylon.write_vector(file_handler, "position", object.location)
-        Export_babylon.write_vector(file_handler, "target", target)
+        Export_babylon.write_vector(file_handler, "rotation", rotation)
         Export_babylon.write_float(file_handler, "fov", object.data.angle)
         Export_babylon.write_float(file_handler, "minZ", object.data.clip_start)
         Export_babylon.write_float(file_handler, "maxZ", object.data.clip_end)

+ 46 - 46
Typescript/babylon.d.ts

@@ -1,49 +1,49 @@
 /// <reference path="babylon.engine.d.ts" />
 /// <reference path="babylon.scene.d.ts" />
-/// <reference path="tools/babylon.math.d.ts" />
-/// <reference path="tools/babylon.sceneLoader.d.ts" />
-/// <reference path="tools/babylon.tools.d.ts" />
-/// <reference path="tools/babylon.database.d.ts" />
-/// <reference path="sprites/babylon.sprite.d.ts" />
-/// <reference path="sprites/babylon.spriteManager.d.ts" />
-/// <reference path="postprocess/babylon.postProcess.d.ts" />
+/// <reference path="Tools/babylon.math.d.ts" />
+/// <reference path="Tools/babylon.sceneLoader.d.ts" />
+/// <reference path="Tools/babylon.tools.d.ts" />
+/// <reference path="Tools/babylon.database.d.ts" />
+/// <reference path="Sprites/Babylon.Sprite.d.ts" />
+/// <reference path="Sprites/Babylon.spriteManager.d.ts" />
+/// <reference path="PostProcess/babylon.postProcess.d.ts" />
 /// <reference path="PostProcess/babylon.postProcessManager.d.ts" />
-/// <reference path="particles/babylon.particle.d.ts" />
-/// <reference path="particles/babylon.particleSystem.d.ts" />
-/// <reference path="mesh/babylon.mesh.d.ts" />
-/// <reference path="mesh/babylon.subMesh.d.ts" />
-/// <reference path="mesh/babylon.vertexBuffer.d.ts" />
-/// <reference path="materials/babylon.effect.d.ts" />
-/// <reference path="materials/babylon.material.d.ts" />
-/// <reference path="materials/babylon.multiMaterial.d.ts" />
-/// <reference path="materials/babylon.standardMaterial.d.ts" />
-/// <reference path="materials/textures/babylon.baseTexture.d.ts" />
-/// <reference path="materials/textures/babylon.texture.d.ts" />
-/// <reference path="materials/textures/babylon.cubeTexture.d.ts" />
-/// <reference path="materials/textures/babylon.renderTargetTexture.d.ts" />
-/// <reference path="materials/textures/babylon.dynamicTexture.d.ts" />
-/// <reference path="materials/textures/babylon.mirrorTexture.d.ts" />
-/// <reference path="materials/textures/babylon.videoTexture.d.ts" />
-/// <reference path="lights/babylon.light.d.ts" />
-/// <reference path="lights/babylon.pointLight.d.ts" />
-/// <reference path="lights/babylon.spotLight.d.ts" />
-/// <reference path="lights/babylon.directionalLight.d.ts" />
-/// <reference path="lights/babylon.hemisphericLight.d.ts" />
-/// <reference path="lights/shadows/babylon.shadowGenerator.d.ts" />
-/// <reference path="layer/babylon.layer.d.ts" />
-/// <reference path="culling/babylon.bounding.d.ts" />
-/// <reference path="culling/babylon.boundingInfo.d.ts" />
-/// <reference path="culling/babylon.boundingSphere.d.ts" />
-/// <reference path="culling/octrees/babylon.octree.d.ts" />
-/// <reference path="culling/octrees/babylon.octreeBlock.d.ts" />
-/// <reference path="collisions/babylon.collider.d.ts" />
-/// <reference path="collisions/babylon.collisionPlane.d.ts" />
-/// <reference path="cameras/babylon.camera.d.ts" />
-/// <reference path="cameras/babylon.freeCamera.d.ts" />
-/// <reference path="cameras/babylon.arcRotateCamera.d.ts" />
-/// <reference path="cameras/babylon.deviceOrientationCamera.d.ts" />
-/// <reference path="cameras/babylon.touchCamera.d.ts" />
-/// <reference path="bones/babylon.bone.d.ts" />
-/// <reference path="bones/babylon.skeleton.d.ts" />
-/// <reference path="animations/babylon.animation.d.ts" />
-/// <reference path="animations/babylon.animatable.d.ts" />
+/// <reference path="Particles/babylon.particle.d.ts" />
+/// <reference path="Particles/babylon.particleSystem.d.ts" />
+/// <reference path="Mesh/babylon.mesh.d.ts" />
+/// <reference path="Mesh/babylon.subMesh.d.ts" />
+/// <reference path="Mesh/babylon.vertexBuffer.d.ts" />
+/// <reference path="Materials/babylon.effect.d.ts" />
+/// <reference path="Materials/babylon.material.d.ts" />
+/// <reference path="Materials/babylon.multiMaterial.d.ts" />
+/// <reference path="Materials/babylon.standardMaterial.d.ts" />
+/// <reference path="Materials/textures/babylon.baseTexture.d.ts" />
+/// <reference path="Materials/textures/babylon.texture.d.ts" />
+/// <reference path="Materials/textures/babylon.cubeTexture.d.ts" />
+/// <reference path="Materials/textures/babylon.renderTargetTexture.d.ts" />
+/// <reference path="Materials/textures/babylon.dynamicTexture.d.ts" />
+/// <reference path="Materials/textures/babylon.mirrorTexture.d.ts" />
+/// <reference path="Materials/textures/babylon.videoTexture.d.ts" />
+/// <reference path="Lights/babylon.light.d.ts" />
+/// <reference path="Lights/babylon.pointLight.d.ts" />
+/// <reference path="Lights/babylon.spotLight.d.ts" />
+/// <reference path="Lights/babylon.directionalLight.d.ts" />
+/// <reference path="Lights/babylon.hemisphericLight.d.ts" />
+/// <reference path="Lights/Shadows/babylon.shadowGenerator.d.ts" />
+/// <reference path="Layer/babylon.layer.d.ts" />
+/// <reference path="Culling/babylon.bounding.d.ts" />
+/// <reference path="Culling/babylon.boundingInfo.d.ts" />
+/// <reference path="Culling/babylon.boundingSphere.d.ts" />
+/// <reference path="Culling/Octrees/babylon.octree.d.ts" />
+/// <reference path="Culling/Octrees/babylon.octreeBlock.d.ts" />
+/// <reference path="Collisions/babylon.collider.d.ts" />
+/// <reference path="Collisions/babylon.collisionPlane.d.ts" />
+/// <reference path="Cameras/babylon.camera.d.ts" />
+/// <reference path="Cameras/babylon.freeCamera.d.ts" />
+/// <reference path="Cameras/babylon.arcRotateCamera.d.ts" />
+/// <reference path="Cameras/babylon.deviceOrientationCamera.d.ts" />
+/// <reference path="Cameras/babylon.touchCamera.d.ts" />
+/// <reference path="Bones/babylon.bone.d.ts" />
+/// <reference path="Bones/babylon.skeleton.d.ts" />
+/// <reference path="Animations/babylon.animation.d.ts" />
+/// <reference path="Animations/babylon.animatable.d.ts" />

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