Bläddra i källkod

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

David Catuhe 7 år sedan
förälder
incheckning
14a74c32d8

BIN
Playground/scenes/Buggy/glTF-Draco/0.bin


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 16995 - 0
Playground/scenes/Buggy/glTF-Draco/Buggy.gltf


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 15818 - 0
Playground/scenes/Buggy/glTF/Buggy.gltf


BIN
Playground/scenes/Buggy/glTF/Buggy0.bin


+ 12 - 0
loaders/src/glTF/2.0/babylon.glTFLoader.ts

@@ -123,6 +123,7 @@ module BABYLON.GLTF2 {
                 this._state = GLTFLoaderState.Loading;
 
                 this._loadData(data);
+                this._checkExtensions();
 
                 const promises = new Array<Promise<void>>();
 
@@ -231,6 +232,17 @@ module BABYLON.GLTF2 {
             }
         }
 
+        private _checkExtensions(): void {
+            if (this._gltf.extensionsRequired) {
+                for (const name of this._gltf.extensionsRequired) {
+                    const extension = this._extensions[name];
+                    if (!extension || !extension.enabled) {
+                        throw new Error(`Require extension ${name} is not available`);
+                    }
+                }
+            }
+        }
+
         private _createRootNode(): ILoaderNode {
             this._rootBabylonMesh = new Mesh("__root__", this._babylonScene);
             const rootNode = { _babylonMesh: this._rootBabylonMesh } as ILoaderNode;

BIN
tests/validation/ReferenceImages/gltfBuggyDraco.png


+ 5 - 0
tests/validation/config.json

@@ -250,6 +250,11 @@
       "excludeFromAutomaticTesting": true
     },
     {
+      "title": "GLTF Buggy with Draco Mesh Compression",
+      "playgroundId": "#JNW207#1",
+      "referenceImage": "gltfBuggyDraco.png"
+    },
+    {
       "title": "Asset Containers",
       "playgroundId": "#P3U079#19",
       "referenceImage": "assetContainer.png"

+ 1 - 0
tests/validation/index.html

@@ -3,6 +3,7 @@
 <head>
 	<title>BabylonJS - Build validation page</title>
 	<link href="index.css" rel="stylesheet" />
+    <script src="../../dist/preview%20release/draco_decoder.js"></script>
 	<script src="../../Tools/DevLoader/BabylonLoader.js"></script>
 </head>
 <body>

+ 1 - 0
tests/validation/karma.conf.browserstack.js

@@ -14,6 +14,7 @@ module.exports = function (config) {
         frameworks: ['mocha', 'chai', 'sinon'],
 
         files: [
+            './dist/preview release/draco_decoder.js',
             './Tools/DevLoader/BabylonLoader.js',
             './tests/validation/index.css',
             './tests/validation/integration.js',

+ 1 - 0
tests/validation/karma.conf.js

@@ -14,6 +14,7 @@ module.exports = function (config) {
         frameworks: ['mocha', 'chai', 'sinon'],
 
         files: [
+            './dist/preview release/draco_decoder.js',
             './Tools/DevLoader/BabylonLoader.js',
             './tests/validation/index.css',
             './tests/validation/integration.js',