Browse Source

Merge branch 'master'

Gary Hsu 9 years ago
parent
commit
381b4e59b9

+ 1 - 1
Tools/Gulp/gulp-addDtsExport.js

@@ -5,7 +5,7 @@ module.exports = function (varName) {
     return through.obj(function (file, enc, cb) {
 
         var moduleExportsAddition =
-            '\nexport as namespace ' + varName + ';\n' +
+ //           '\nexport as namespace ' + varName + ';\n' +
             '\nexport = ' + varName + ';\n';
 
         if (file.isNull()) {

+ 0 - 2
dist/preview release/babylon.d.ts

@@ -15261,6 +15261,4 @@ declare module BABYLON {
     }
 }
 
-export as namespace BABYLON;
-
 export = BABYLON;

+ 6 - 6
loaders/OBJ/babylon.objFileLoader.ts

@@ -229,12 +229,12 @@ module BABYLON {
             var pathOfFile = BABYLON.Tools.BaseUrl + rootUrl + url;
 
             // Loads through the babylon tools to allow fileInput search.
-            BABYLON.Tools.LoadFile(pathOfFile,
-                onSuccess,
-                null,
-                null,
-                false,
-                () => { console.warn("Error - Unable to load " + pathOfFile); });
+            BABYLON.Tools.LoadFile(pathOfFile, 
+                onSuccess, 
+                null, 
+                null, 
+                false, 
+                () => { console.warn("Error - Unable to load " + pathOfFile); });
         }
 
         public importMesh(meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]): boolean {

+ 5 - 1
loaders/glTF/babylon.glTFFileLoader.ts

@@ -717,7 +717,6 @@
         // Apply geometry
         geometry.setAllVerticesData(vertexData, false);
 
-        newMesh.flipFaces(true);
         newMesh.computeWorldMatrix(true);
 
         // Apply submeshes
@@ -1463,6 +1462,7 @@
             var shaderMaterial = new ShaderMaterial(id, gltfRuntime.scene, shaderPath, options);
             shaderMaterial.onError = onShaderCompileError(program, shaderMaterial, onError);
             shaderMaterial.onCompiled = onShaderCompileSuccess(gltfRuntime, shaderMaterial, technique, material, unTreatedUniforms, onSuccess);
+            shaderMaterial.sideOrientation = Material.CounterClockWiseSideOrientation;
 
             if (states.functions) {
                 var functions = states.functions;
@@ -1533,6 +1533,8 @@
         * Import meshes
         */
         public importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError?: () => void): boolean {
+            scene.useRightHandedSystem = true;
+
             var gltfRuntime = GLTFFileLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => {
                 gltfRuntime.importOnlyMeshes = true;
 
@@ -1593,6 +1595,8 @@
         * Load scene
         */
         public loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onError: () => void): boolean {
+            scene.useRightHandedSystem = true;
+
             GLTFFileLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => {
                 // Create nodes
                 this._createNodes(gltfRuntime);