Quellcode durchsuchen

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

Guide vor 7 Jahren
Ursprung
Commit
347578a3c5
43 geänderte Dateien mit 21067 neuen und 274141 gelöschten Zeilen
  1. 12564 12160
      Playground/babylon.d.txt
  2. 0 69
      Tools/Gulp/config.json
  3. 7 23
      Tools/Gulp/gulpfile.js
  4. 3 3
      Viewer/src/viewer/viewer.ts
  5. 8103 8085
      dist/preview release/babylon.d.ts
  6. 51 51
      dist/preview release/babylon.js
  7. 45 9
      dist/preview release/babylon.max.js
  8. 52 52
      dist/preview release/babylon.worker.js
  9. 0 29676
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts
  10. 0 62
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js
  11. 0 96733
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js
  12. 0 30389
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts
  13. 0 96703
      dist/preview release/customConfigurations/minimalGLTFViewer/es6.js
  14. 45 9
      dist/preview release/es6.js
  15. 4 4
      dist/preview release/gui/babylon.gui.min.js
  16. 4 4
      dist/preview release/inspector/babylon.inspector.bundle.js
  17. 3 3
      dist/preview release/inspector/babylon.inspector.min.js
  18. 2 2
      dist/preview release/loaders/babylon.glTF1FileLoader.min.js
  19. 2 2
      dist/preview release/loaders/babylon.glTF2FileLoader.min.js
  20. 3 3
      dist/preview release/loaders/babylon.glTFFileLoader.min.js
  21. 1 1
      dist/preview release/loaders/babylon.objFileLoader.min.js
  22. 3 3
      dist/preview release/loaders/babylonjs.loaders.min.js
  23. 1 1
      dist/preview release/materialsLibrary/babylon.customMaterial.min.js
  24. 2 2
      dist/preview release/materialsLibrary/babylon.gradientMaterial.js
  25. 1 1
      dist/preview release/materialsLibrary/babylon.gradientMaterial.min.js
  26. 1 1
      dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.min.js
  27. 1 1
      dist/preview release/materialsLibrary/babylon.waterMaterial.min.js
  28. 2 2
      dist/preview release/materialsLibrary/babylonjs.materials.js
  29. 3 3
      dist/preview release/materialsLibrary/babylonjs.materials.min.js
  30. 1 1
      dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.min.js
  31. 1 1
      dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js
  32. 1 1
      dist/preview release/postProcessesLibrary/babylonjs.postProcess.min.js
  33. 1 1
      dist/preview release/serializers/babylon.glTF2Serializer.min.js
  34. 1 1
      dist/preview release/serializers/babylonjs.serializers.min.js
  35. 4 4
      dist/preview release/viewer/babylon.viewer.d.ts
  36. 59 59
      dist/preview release/viewer/babylon.viewer.js
  37. 48 11
      dist/preview release/viewer/babylon.viewer.max.js
  38. 2 1
      materialsLibrary/src/gradient/gradient.fragment.fx
  39. 2 0
      materialsLibrary/src/gradient/gradient.vertex.fx
  40. 1 1
      src/Engine/babylon.engine.ts
  41. 39 1
      src/Mesh/babylon.transformNode.ts
  42. 3 2
      src/babylon.node.ts
  43. 1 0
      what's new.md

Datei-Diff unterdrückt, da er zu groß ist
+ 12564 - 12160
Playground/babylon.d.txt


+ 0 - 69
Tools/Gulp/config.json

@@ -110,75 +110,6 @@
             "meshBuilder",
             "freeCamera",
             "hemisphericLight"
-        ],
-        "minimalGLTFViewer": [
-            "pbrMaterial",
-            "freeCamera",
-            "arcRotateCamera",
-            "hemisphericLight",
-            "pointLight",
-            "directionalLight",
-            "spotLight",
-            "animations",
-            "actions",
-            "sprites",
-            "picking",
-            "collisions",
-            "particles",
-            "solidParticles",
-            "additionalMeshes",
-            "meshBuilder",
-            "meshCompression",
-            "audio",
-            "additionalTextures",
-            "shadows",
-            "loader",
-            "userData",
-            "offline",
-            "fresnel",
-            "multiMaterial",
-            "touchCamera",
-            "procedural",
-            "gamepad",
-            "additionalCameras",
-            "postProcesses",
-            "renderingPipeline",
-            "additionalRenderingPipeline",
-            "defaultRenderingPipeline",
-            "depthRenderer",
-            "geometryBufferRenderer",
-            "additionalPostProcesses",
-            "additionalPostProcess_blur",
-            "additionalPostProcess_fxaa",
-            "additionalPostProcess_imageProcessing",
-            "bones",
-            "hdr",
-            "polygonMesh",
-            "csg",
-            "lensFlares",
-            "physics",
-            "textureFormats",
-            "debug",
-            "morphTargets",
-            "octrees",
-            "vr",
-            "virtualJoystick",
-            "optimizations",
-            "highlights",
-            "assetsManager",
-            "serialization",
-            "probes",
-            "layer",
-            "textureTools",
-            "cameraBehaviors",
-            "instrumentation",
-            "backgroundMaterial",
-            "environmentHelper",
-            "materialsLibrary/babylon.gridMaterial.js",
-            "loaders/babylon.glTFFileLoader.js"
-        ],
-        "distributed": [
-            "minimalGLTFViewer"
         ]
     },
     "workloads": {

+ 7 - 23
Tools/Gulp/gulpfile.js

@@ -532,21 +532,6 @@ gulp.task("typescript-libraries", config.modules, function () {
 });
 
 /**
- * Dynamic custom configurations.
- */
-config.buildConfigurations.distributed.map(function (customConfiguration) {
-    gulp.task(customConfiguration, function (cb) {
-        config.build.currentConfig = customConfiguration;
-        config.build.outputDirectory = config.build.outputCustomConfigurationsDirectory + "/" + customConfiguration;
-        runSequence("typescript-compile", "build", cb);
-    });
-});
-
-gulp.task("typescript-customConfigurations", function (cb) {
-    runSequence(config.buildConfigurations.distributed, cb);
-});
-
-/**
  * Custom build with full path file control; used by profile.html
  */
 gulp.task("build-custom", function (cb) {
@@ -557,7 +542,7 @@ gulp.task("build-custom", function (cb) {
  * Do it all.
  */
 gulp.task("typescript-all", function (cb) {
-    runSequence("typescript", "typescript-libraries", "typescript-customConfigurations", cb);
+    runSequence("typescript", "typescript-libraries", cb);
 });
 
 /**
@@ -604,13 +589,12 @@ gulp.task("watch", ["srcTscWatch"], function () {
 
 gulp.task("intellisense", function () {
     gulp.src(config.build.intellisenseSources)
-        .pipe(concat(config.build.intellisenseFile))
-        .pipe(replace(/^\s*_.*?$/gm, ""))
-        .pipe(replace(/^\s*private .*?$/gm, ""))
-        .pipe(replace(/^\s*public _.*?$/gm, ""))
-        .pipe(replace(/^\s*protected .*?$/gm, ""))
-        .pipe(replace(/^\s*public static _.*?$/gm, ""))
-        .pipe(replace(/^\s*static _.*?$/gm, ""))
+        .pipe(concat(config.build.intellisenseFile))    
+        .pipe(replace(/^\s+_.*?;/gm, ""))
+        .pipe(replace(/^\s+_[\S\s]*?}/gm, ""))
+        .pipe(replace(/^\s*readonly _/gm, "protected readonly _"))
+        .pipe(replace(/^\s*static _/gm, "private static _"))
+        .pipe(replace(/^\s*abstract _/gm, ""))
         .pipe(gulp.dest(config.build.playgroundDirectory));
 });
 

+ 3 - 3
Viewer/src/viewer/viewer.ts

@@ -930,9 +930,9 @@ export abstract class AbstractViewer {
 
     /**
      * Alters render settings to reduce features based on hardware feature limitations
-     * @param options Viewer options to modify
+     * @param enableHDR Allows the viewer to run in HDR mode.
      */
-    protected _handleHardwareLimitations() {
+    protected _handleHardwareLimitations(enableHDR = true) {
         //flip rendering settings switches based on hardware support
         let maxVaryingRows = this.engine.getCaps().maxVaryingVectors;
         let maxFragmentSamplers = this.engine.getCaps().maxTexturesImageUnits;
@@ -949,7 +949,7 @@ export abstract class AbstractViewer {
         let linearHalfFloatTargets = caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering;
         let linearFloatTargets = caps.textureFloatRender && caps.textureFloatLinearFiltering;
 
-        this._hdrSupport = !!(linearFloatTargets || linearHalfFloatTargets);
+        this._hdrSupport = enableHDR && !!(linearFloatTargets || linearHalfFloatTargets);
 
         if (linearHalfFloatTargets) {
             this._defaultHighpTextureType = Engine.TEXTURETYPE_HALF_FLOAT;

Datei-Diff unterdrückt, da er zu groß ist
+ 8103 - 8085
dist/preview release/babylon.d.ts


Datei-Diff unterdrückt, da er zu groß ist
+ 51 - 51
dist/preview release/babylon.js


+ 45 - 9
dist/preview release/babylon.max.js

@@ -11262,7 +11262,7 @@ var BABYLON;
         });
         Object.defineProperty(Engine, "Version", {
             get: function () {
-                return "3.2.0-beta.1";
+                return "3.2.0-beta.2";
             },
             enumerable: true,
             configurable: true
@@ -15709,6 +15709,7 @@ var BABYLON;
             /** @ignore */
             this._currentRenderId = -1;
             this._parentRenderId = -1;
+            this._childRenderId = -1;
             this._animationPropertiesOverride = null;
             /**
             * An event triggered when the mesh is disposed
@@ -15912,7 +15913,7 @@ var BABYLON;
         /** @ignore */
         Node.prototype._markSyncedWithParent = function () {
             if (this.parent) {
-                this._parentRenderId = this.parent._currentRenderId;
+                this._parentRenderId = this.parent._childRenderId;
             }
         };
         /** @ignore */
@@ -15920,7 +15921,7 @@ var BABYLON;
             if (!this.parent) {
                 return true;
             }
-            if (this._parentRenderId !== this.parent._currentRenderId) {
+            if (this._parentRenderId !== this.parent._childRenderId) {
                 return false;
             }
             return this.parent.isSynchronized();
@@ -16598,6 +16599,11 @@ var BABYLON;
             if (scene === void 0) { scene = null; }
             if (isPure === void 0) { isPure = true; }
             var _this = _super.call(this, name, scene) || this;
+            _this._forward = new BABYLON.Vector3(0, 0, 1);
+            _this._forwardInverted = new BABYLON.Vector3(0, 0, -1);
+            _this._up = new BABYLON.Vector3(0, 1, 0);
+            _this._right = new BABYLON.Vector3(1, 0, 0);
+            _this._rightInverted = new BABYLON.Vector3(-1, 0, 0);
             // Properties
             _this._rotation = BABYLON.Vector3.Zero();
             _this._scaling = BABYLON.Vector3.One();
@@ -16683,6 +16689,36 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(TransformNode.prototype, "forward", {
+            /**
+             * The forward direction of that transform in world space.
+             */
+            get: function () {
+                return BABYLON.Vector3.Normalize(BABYLON.Vector3.TransformNormal(this.getScene().useRightHandedSystem ? this._forwardInverted : this._forward, this.getWorldMatrix()));
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(TransformNode.prototype, "up", {
+            /**
+             * The up direction of that transform in world space.
+             */
+            get: function () {
+                return BABYLON.Vector3.Normalize(BABYLON.Vector3.TransformNormal(this._up, this.getWorldMatrix()));
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(TransformNode.prototype, "right", {
+            /**
+             * The right direction of that transform in world space.
+             */
+            get: function () {
+                return BABYLON.Vector3.Normalize(BABYLON.Vector3.TransformNormal(this.getScene().useRightHandedSystem ? this._rightInverted : this._right, this.getWorldMatrix()));
+            },
+            enumerable: true,
+            configurable: true
+        });
         /**
          * Returns the latest update of the World matrix
          * Returns a Matrix.
@@ -17228,6 +17264,7 @@ var BABYLON;
                 return this._worldMatrix;
             }
             if (!force && this.isSynchronized(true)) {
+                this._currentRenderId = this.getScene().getRenderId();
                 return this._worldMatrix;
             }
             this._cache.position.copyFrom(this.position);
@@ -17235,6 +17272,7 @@ var BABYLON;
             this._cache.pivotMatrixUpdated = false;
             this._cache.billboardMode = this.billboardMode;
             this._currentRenderId = this.getScene().getRenderId();
+            this._childRenderId = this.getScene().getRenderId();
             this._isDirty = false;
             // Scaling
             BABYLON.Matrix.ScalingToRef(this.scaling.x * this.scalingDeterminant, this.scaling.y * this.scalingDeterminant, this.scaling.z * this.scalingDeterminant, BABYLON.Tmp.Matrix[1]);
@@ -78586,15 +78624,14 @@ var BABYLON;
             if (!this._intersectsWithSphere(impostor, origin, radius)) {
                 return null;
             }
-            if (impostor.object.getClassName() !== 'Mesh') {
+            if (impostor.object.getClassName() !== 'Mesh' && impostor.object.getClassName() !== 'InstancedMesh') {
                 return null;
             }
-            var impostorObject = impostor.object;
             var impostorObjectCenter = impostor.getObjectCenter();
             var direction = impostorObjectCenter.subtract(origin);
             var ray = new BABYLON.Ray(origin, direction, radius);
             this._rays.push(ray);
-            var hit = ray.intersectsMesh(impostorObject);
+            var hit = ray.intersectsMesh(impostor.object);
             var contactPoint = hit.pickedPoint;
             if (!contactPoint) {
                 return null;
@@ -78890,15 +78927,14 @@ var BABYLON;
             if (!this._intersectsWithCylinder(impostor)) {
                 return null;
             }
-            if (impostor.object.getClassName() !== 'Mesh') {
+            if (impostor.object.getClassName() !== 'Mesh' && impostor.object.getClassName() !== 'InstancedMesh') {
                 return null;
             }
-            var impostorObject = impostor.object;
             var impostorObjectCenter = impostor.getObjectCenter();
             var originOnPlane = new BABYLON.Vector3(this._origin.x, impostorObjectCenter.y, this._origin.z); // the distance to the origin as if both objects were on a plane (Y-axis)
             var originToImpostorDirection = impostorObjectCenter.subtract(originOnPlane);
             var ray = new BABYLON.Ray(originOnPlane, originToImpostorDirection, this._radius);
-            var hit = ray.intersectsMesh(impostorObject);
+            var hit = ray.intersectsMesh(impostor.object);
             var contactPoint = hit.pickedPoint;
             if (!contactPoint) {
                 return null;

Datei-Diff unterdrückt, da er zu groß ist
+ 52 - 52
dist/preview release/babylon.worker.js


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 29676
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 62
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 96733
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 30389
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 96703
dist/preview release/customConfigurations/minimalGLTFViewer/es6.js


+ 45 - 9
dist/preview release/es6.js

@@ -11234,7 +11234,7 @@ var BABYLON;
         });
         Object.defineProperty(Engine, "Version", {
             get: function () {
-                return "3.2.0-beta.1";
+                return "3.2.0-beta.2";
             },
             enumerable: true,
             configurable: true
@@ -15681,6 +15681,7 @@ var BABYLON;
             /** @ignore */
             this._currentRenderId = -1;
             this._parentRenderId = -1;
+            this._childRenderId = -1;
             this._animationPropertiesOverride = null;
             /**
             * An event triggered when the mesh is disposed
@@ -15884,7 +15885,7 @@ var BABYLON;
         /** @ignore */
         Node.prototype._markSyncedWithParent = function () {
             if (this.parent) {
-                this._parentRenderId = this.parent._currentRenderId;
+                this._parentRenderId = this.parent._childRenderId;
             }
         };
         /** @ignore */
@@ -15892,7 +15893,7 @@ var BABYLON;
             if (!this.parent) {
                 return true;
             }
-            if (this._parentRenderId !== this.parent._currentRenderId) {
+            if (this._parentRenderId !== this.parent._childRenderId) {
                 return false;
             }
             return this.parent.isSynchronized();
@@ -16570,6 +16571,11 @@ var BABYLON;
             if (scene === void 0) { scene = null; }
             if (isPure === void 0) { isPure = true; }
             var _this = _super.call(this, name, scene) || this;
+            _this._forward = new BABYLON.Vector3(0, 0, 1);
+            _this._forwardInverted = new BABYLON.Vector3(0, 0, -1);
+            _this._up = new BABYLON.Vector3(0, 1, 0);
+            _this._right = new BABYLON.Vector3(1, 0, 0);
+            _this._rightInverted = new BABYLON.Vector3(-1, 0, 0);
             // Properties
             _this._rotation = BABYLON.Vector3.Zero();
             _this._scaling = BABYLON.Vector3.One();
@@ -16655,6 +16661,36 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(TransformNode.prototype, "forward", {
+            /**
+             * The forward direction of that transform in world space.
+             */
+            get: function () {
+                return BABYLON.Vector3.Normalize(BABYLON.Vector3.TransformNormal(this.getScene().useRightHandedSystem ? this._forwardInverted : this._forward, this.getWorldMatrix()));
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(TransformNode.prototype, "up", {
+            /**
+             * The up direction of that transform in world space.
+             */
+            get: function () {
+                return BABYLON.Vector3.Normalize(BABYLON.Vector3.TransformNormal(this._up, this.getWorldMatrix()));
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(TransformNode.prototype, "right", {
+            /**
+             * The right direction of that transform in world space.
+             */
+            get: function () {
+                return BABYLON.Vector3.Normalize(BABYLON.Vector3.TransformNormal(this.getScene().useRightHandedSystem ? this._rightInverted : this._right, this.getWorldMatrix()));
+            },
+            enumerable: true,
+            configurable: true
+        });
         /**
          * Returns the latest update of the World matrix
          * Returns a Matrix.
@@ -17200,6 +17236,7 @@ var BABYLON;
                 return this._worldMatrix;
             }
             if (!force && this.isSynchronized(true)) {
+                this._currentRenderId = this.getScene().getRenderId();
                 return this._worldMatrix;
             }
             this._cache.position.copyFrom(this.position);
@@ -17207,6 +17244,7 @@ var BABYLON;
             this._cache.pivotMatrixUpdated = false;
             this._cache.billboardMode = this.billboardMode;
             this._currentRenderId = this.getScene().getRenderId();
+            this._childRenderId = this.getScene().getRenderId();
             this._isDirty = false;
             // Scaling
             BABYLON.Matrix.ScalingToRef(this.scaling.x * this.scalingDeterminant, this.scaling.y * this.scalingDeterminant, this.scaling.z * this.scalingDeterminant, BABYLON.Tmp.Matrix[1]);
@@ -78558,15 +78596,14 @@ var BABYLON;
             if (!this._intersectsWithSphere(impostor, origin, radius)) {
                 return null;
             }
-            if (impostor.object.getClassName() !== 'Mesh') {
+            if (impostor.object.getClassName() !== 'Mesh' && impostor.object.getClassName() !== 'InstancedMesh') {
                 return null;
             }
-            var impostorObject = impostor.object;
             var impostorObjectCenter = impostor.getObjectCenter();
             var direction = impostorObjectCenter.subtract(origin);
             var ray = new BABYLON.Ray(origin, direction, radius);
             this._rays.push(ray);
-            var hit = ray.intersectsMesh(impostorObject);
+            var hit = ray.intersectsMesh(impostor.object);
             var contactPoint = hit.pickedPoint;
             if (!contactPoint) {
                 return null;
@@ -78862,15 +78899,14 @@ var BABYLON;
             if (!this._intersectsWithCylinder(impostor)) {
                 return null;
             }
-            if (impostor.object.getClassName() !== 'Mesh') {
+            if (impostor.object.getClassName() !== 'Mesh' && impostor.object.getClassName() !== 'InstancedMesh') {
                 return null;
             }
-            var impostorObject = impostor.object;
             var impostorObjectCenter = impostor.getObjectCenter();
             var originOnPlane = new BABYLON.Vector3(this._origin.x, impostorObjectCenter.y, this._origin.z); // the distance to the origin as if both objects were on a plane (Y-axis)
             var originToImpostorDirection = impostorObjectCenter.subtract(originOnPlane);
             var ray = new BABYLON.Ray(originOnPlane, originToImpostorDirection, this._radius);
-            var hit = ray.intersectsMesh(impostorObject);
+            var hit = ray.intersectsMesh(impostor.object);
             var contactPoint = hit.pickedPoint;
             if (!contactPoint) {
                 return null;

Datei-Diff unterdrückt, da er zu groß ist
+ 4 - 4
dist/preview release/gui/babylon.gui.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 4 - 4
dist/preview release/inspector/babylon.inspector.bundle.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 3
dist/preview release/inspector/babylon.inspector.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 2 - 2
dist/preview release/loaders/babylon.glTF1FileLoader.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 2 - 2
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 3
dist/preview release/loaders/babylon.glTFFileLoader.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/loaders/babylon.objFileLoader.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 3
dist/preview release/loaders/babylonjs.loaders.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/materialsLibrary/babylon.customMaterial.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 2 - 2
dist/preview release/materialsLibrary/babylon.gradientMaterial.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/materialsLibrary/babylon.gradientMaterial.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/materialsLibrary/babylon.waterMaterial.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 2 - 2
dist/preview release/materialsLibrary/babylonjs.materials.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 3
dist/preview release/materialsLibrary/babylonjs.materials.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/postProcessesLibrary/babylonjs.postProcess.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/serializers/babylon.glTF2Serializer.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/serializers/babylonjs.serializers.min.js


+ 4 - 4
dist/preview release/viewer/babylon.viewer.d.ts

@@ -1099,10 +1099,10 @@ declare module BabylonViewer {
          */
         protected _initEnvironment(model?: ViewerModel): Promise<BABYLON.Scene>;
         /**
-         * Alters render settings to reduce features based on hardware feature limitations
-         * @param options Viewer options to modify
-         */
-        protected _handleHardwareLimitations(): void;
+		 * Alters render settings to reduce features based on hardware feature limitations
+		 * @param enableHDR Allows the viewer to run in HDR mode.
+		 */
+        protected _handleHardwareLimitations(enableHDR?: boolean): void;
         /**
          * Injects all the spectre shader in the babylon shader store
          */

Datei-Diff unterdrückt, da er zu groß ist
+ 59 - 59
dist/preview release/viewer/babylon.viewer.js


+ 48 - 11
dist/preview release/viewer/babylon.viewer.max.js

@@ -11350,7 +11350,7 @@ var BABYLON;
         });
         Object.defineProperty(Engine, "Version", {
             get: function () {
-                return "3.2.0-beta.1";
+                return "3.2.0-beta.2";
             },
             enumerable: true,
             configurable: true
@@ -15797,6 +15797,7 @@ var BABYLON;
             /** @ignore */
             this._currentRenderId = -1;
             this._parentRenderId = -1;
+            this._childRenderId = -1;
             this._animationPropertiesOverride = null;
             /**
             * An event triggered when the mesh is disposed
@@ -16000,7 +16001,7 @@ var BABYLON;
         /** @ignore */
         Node.prototype._markSyncedWithParent = function () {
             if (this.parent) {
-                this._parentRenderId = this.parent._currentRenderId;
+                this._parentRenderId = this.parent._childRenderId;
             }
         };
         /** @ignore */
@@ -16008,7 +16009,7 @@ var BABYLON;
             if (!this.parent) {
                 return true;
             }
-            if (this._parentRenderId !== this.parent._currentRenderId) {
+            if (this._parentRenderId !== this.parent._childRenderId) {
                 return false;
             }
             return this.parent.isSynchronized();
@@ -16686,6 +16687,11 @@ var BABYLON;
             if (scene === void 0) { scene = null; }
             if (isPure === void 0) { isPure = true; }
             var _this = _super.call(this, name, scene) || this;
+            _this._forward = new BABYLON.Vector3(0, 0, 1);
+            _this._forwardInverted = new BABYLON.Vector3(0, 0, -1);
+            _this._up = new BABYLON.Vector3(0, 1, 0);
+            _this._right = new BABYLON.Vector3(1, 0, 0);
+            _this._rightInverted = new BABYLON.Vector3(-1, 0, 0);
             // Properties
             _this._rotation = BABYLON.Vector3.Zero();
             _this._scaling = BABYLON.Vector3.One();
@@ -16771,6 +16777,36 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(TransformNode.prototype, "forward", {
+            /**
+             * The forward direction of that transform in world space.
+             */
+            get: function () {
+                return BABYLON.Vector3.Normalize(BABYLON.Vector3.TransformNormal(this.getScene().useRightHandedSystem ? this._forwardInverted : this._forward, this.getWorldMatrix()));
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(TransformNode.prototype, "up", {
+            /**
+             * The up direction of that transform in world space.
+             */
+            get: function () {
+                return BABYLON.Vector3.Normalize(BABYLON.Vector3.TransformNormal(this._up, this.getWorldMatrix()));
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(TransformNode.prototype, "right", {
+            /**
+             * The right direction of that transform in world space.
+             */
+            get: function () {
+                return BABYLON.Vector3.Normalize(BABYLON.Vector3.TransformNormal(this.getScene().useRightHandedSystem ? this._rightInverted : this._right, this.getWorldMatrix()));
+            },
+            enumerable: true,
+            configurable: true
+        });
         /**
          * Returns the latest update of the World matrix
          * Returns a Matrix.
@@ -17316,6 +17352,7 @@ var BABYLON;
                 return this._worldMatrix;
             }
             if (!force && this.isSynchronized(true)) {
+                this._currentRenderId = this.getScene().getRenderId();
                 return this._worldMatrix;
             }
             this._cache.position.copyFrom(this.position);
@@ -17323,6 +17360,7 @@ var BABYLON;
             this._cache.pivotMatrixUpdated = false;
             this._cache.billboardMode = this.billboardMode;
             this._currentRenderId = this.getScene().getRenderId();
+            this._childRenderId = this.getScene().getRenderId();
             this._isDirty = false;
             // Scaling
             BABYLON.Matrix.ScalingToRef(this.scaling.x * this.scalingDeterminant, this.scaling.y * this.scalingDeterminant, this.scaling.z * this.scalingDeterminant, BABYLON.Tmp.Matrix[1]);
@@ -78674,15 +78712,14 @@ var BABYLON;
             if (!this._intersectsWithSphere(impostor, origin, radius)) {
                 return null;
             }
-            if (impostor.object.getClassName() !== 'Mesh') {
+            if (impostor.object.getClassName() !== 'Mesh' && impostor.object.getClassName() !== 'InstancedMesh') {
                 return null;
             }
-            var impostorObject = impostor.object;
             var impostorObjectCenter = impostor.getObjectCenter();
             var direction = impostorObjectCenter.subtract(origin);
             var ray = new BABYLON.Ray(origin, direction, radius);
             this._rays.push(ray);
-            var hit = ray.intersectsMesh(impostorObject);
+            var hit = ray.intersectsMesh(impostor.object);
             var contactPoint = hit.pickedPoint;
             if (!contactPoint) {
                 return null;
@@ -78978,15 +79015,14 @@ var BABYLON;
             if (!this._intersectsWithCylinder(impostor)) {
                 return null;
             }
-            if (impostor.object.getClassName() !== 'Mesh') {
+            if (impostor.object.getClassName() !== 'Mesh' && impostor.object.getClassName() !== 'InstancedMesh') {
                 return null;
             }
-            var impostorObject = impostor.object;
             var impostorObjectCenter = impostor.getObjectCenter();
             var originOnPlane = new BABYLON.Vector3(this._origin.x, impostorObjectCenter.y, this._origin.z); // the distance to the origin as if both objects were on a plane (Y-axis)
             var originToImpostorDirection = impostorObjectCenter.subtract(originOnPlane);
             var ray = new BABYLON.Ray(originOnPlane, originToImpostorDirection, this._radius);
-            var hit = ray.intersectsMesh(impostorObject);
+            var hit = ray.intersectsMesh(impostor.object);
             var contactPoint = hit.pickedPoint;
             if (!contactPoint) {
                 return null;
@@ -94397,7 +94433,8 @@ var AbstractViewer = (function () {
         this._configureEnvironment(this._configuration.skybox, this._configuration.ground);
         return Promise.resolve(this.scene);
     };
-    AbstractViewer.prototype._handleHardwareLimitations = function () {
+    AbstractViewer.prototype._handleHardwareLimitations = function (enableHDR) {
+        if (enableHDR === void 0) { enableHDR = true; }
         var maxVaryingRows = this.engine.getCaps().maxVaryingVectors;
         var maxFragmentSamplers = this.engine.getCaps().maxTexturesImageUnits;
         if ((maxVaryingRows < 8) || (maxFragmentSamplers < 8)) {
@@ -94409,7 +94446,7 @@ var AbstractViewer = (function () {
         var caps = this.engine.getCaps();
         var linearHalfFloatTargets = caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering;
         var linearFloatTargets = caps.textureFloatRender && caps.textureFloatLinearFiltering;
-        this._hdrSupport = !!(linearFloatTargets || linearHalfFloatTargets);
+        this._hdrSupport = enableHDR && !!(linearFloatTargets || linearHalfFloatTargets);
         if (linearHalfFloatTargets) {
             this._defaultHighpTextureType = babylonjs_1.Engine.TEXTURETYPE_HALF_FLOAT;
             this._shadowGeneratorBias = 0.002;

+ 2 - 1
materialsLibrary/src/gradient/gradient.fragment.fx

@@ -12,6 +12,7 @@ uniform float smoothness;
 
 // Input
 varying vec3 vPositionW;
+varying vec3 vPosition;
 
 #ifdef NORMAL
 varying vec3 vNormalW;
@@ -51,7 +52,7 @@ void main(void) {
 
 	vec3 viewDirectionW = normalize(vEyePosition - vPositionW);
 
-    float h = normalize(vPositionW).y + offset;
+    float h = normalize(vPosition).y + offset;
     float mysmoothness = clamp(smoothness, 0.01, max(smoothness, 10.));
 
     vec4 baseColor = mix(bottomColor, topColor, max(pow(max(h, 0.0), mysmoothness), 0.0));

+ 2 - 0
materialsLibrary/src/gradient/gradient.vertex.fx

@@ -35,6 +35,7 @@ uniform float pointSize;
 
 // Output
 varying vec3 vPositionW;
+varying vec3 vPosition;
 #ifdef NORMAL
 varying vec3 vNormalW;
 #endif
@@ -56,6 +57,7 @@ void main(void) {
 
 	vec4 worldPos = finalWorld * vec4(position, 1.0);
 	vPositionW = vec3(worldPos);
+	vPosition = position;
 
 #ifdef NORMAL
 	vNormalW = normalize(vec3(finalWorld * vec4(normal, 0.0)));

+ 1 - 1
src/Engine/babylon.engine.ts

@@ -597,7 +597,7 @@
         }
 
         public static get Version(): string {
-            return "3.2.0-beta.1";
+            return "3.2.0-beta.2";
         }
 
         // Updatable statics so stick with vars here

+ 39 - 1
src/Mesh/babylon.transformNode.ts

@@ -6,6 +6,12 @@ module BABYLON {
         public static BILLBOARDMODE_Y = 2;
         public static BILLBOARDMODE_Z = 4;
         public static BILLBOARDMODE_ALL = 7;
+        
+        private _forward = new Vector3(0, 0, 1);
+        private _forwardInverted = new Vector3(0, 0, -1);
+        private _up = new Vector3(0, 1, 0);
+        private _right = new Vector3(1, 0, 0);
+        private _rightInverted = new Vector3(-1, 0, 0);
 
         // Properties
         @serializeAsVector3()
@@ -112,6 +118,36 @@ module BABYLON {
         }
 
         /**
+         * The forward direction of that transform in world space.
+         */
+        public get forward(): Vector3 {
+            return Vector3.Normalize(Vector3.TransformNormal(
+                this.getScene().useRightHandedSystem ? this._forwardInverted : this._forward,
+                this.getWorldMatrix()
+            ));
+        }
+
+        /**
+         * The up direction of that transform in world space.
+         */
+        public get up(): Vector3 {
+            return Vector3.Normalize(Vector3.TransformNormal(
+                this._up,
+                this.getWorldMatrix()
+            ));
+        }
+
+        /**
+         * The right direction of that transform in world space.
+         */
+        public get right(): Vector3 {
+            return Vector3.Normalize(Vector3.TransformNormal(
+                this.getScene().useRightHandedSystem ? this._rightInverted : this._right,
+                this.getWorldMatrix()
+            ));
+        }
+
+        /**
          * Returns the latest update of the World matrix
          * Returns a Matrix.  
          */
@@ -705,6 +741,7 @@ module BABYLON {
             }
 
             if (!force && this.isSynchronized(true)) {
+                this._currentRenderId = this.getScene().getRenderId();
                 return this._worldMatrix;
             }
 
@@ -713,6 +750,7 @@ module BABYLON {
             this._cache.pivotMatrixUpdated = false;
             this._cache.billboardMode = this.billboardMode;
             this._currentRenderId = this.getScene().getRenderId();
+            this._childRenderId = this.getScene().getRenderId();
             this._isDirty = false;
 
             // Scaling
@@ -990,4 +1028,4 @@ module BABYLON {
         }
 
     }
-}
+}

+ 3 - 2
src/babylon.node.ts

@@ -58,6 +58,7 @@
         /** @ignore */
         public _currentRenderId = -1;
         private _parentRenderId = -1;
+        protected _childRenderId = -1;
 
         /** @ignore */
         public _waitingParentId: Nullable<string>;
@@ -295,7 +296,7 @@
         /** @ignore */
         public _markSyncedWithParent() {
             if (this.parent) {
-                this._parentRenderId = this.parent._currentRenderId;
+                this._parentRenderId = this.parent._childRenderId;
             }
         }
 
@@ -305,7 +306,7 @@
                 return true;
             }
 
-            if (this._parentRenderId !== this.parent._currentRenderId) {
+            if (this._parentRenderId !== this.parent._childRenderId) {
                 return false;
             }
 

+ 1 - 0
what's new.md

@@ -66,6 +66,7 @@
 - Added scope option to Observerable ([adam](https://github.com/abow))
 - Added shadowBlur, shadowOffsetX, shadowOffsetY, shadowColor to GUI Controls ([adam](https://github.com/abow))
 - Added alignWithNormal to AbstractMesh ([adam](https://github.com/abow))
+- Added transformNode.forward/up/right ([bobalazek](https://github.com/bobalazek))
 
 ## Bug fixes