Prechádzať zdrojové kódy

adding animationpropertiesOverride to morphtarget

David Catuhe 7 rokov pred
rodič
commit
8a29b0b913

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 5004 - 4998
Playground/babylon.d.txt


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 4893 - 4887
dist/preview release/babylon.d.ts


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 2 - 2
dist/preview release/babylon.js


+ 21 - 2
dist/preview release/babylon.max.js

@@ -86100,8 +86100,9 @@ var BABYLON;
          */
         function MorphTarget(
         /** defines the name of the target */
-        name, influence) {
+        name, influence, scene) {
             if (influence === void 0) { influence = 0; }
+            if (scene === void 0) { scene = null; }
             this.name = name;
             /**
              * Gets or sets the list of animations
@@ -86114,6 +86115,8 @@ var BABYLON;
              * Observable raised when the influence changes
              */
             this.onInfluenceChanged = new BABYLON.Observable();
+            this._animationPropertiesOverride = null;
+            this._scene = scene || BABYLON.Engine.LastCreatedScene;
             this.influence = influence;
         }
         Object.defineProperty(MorphTarget.prototype, "influence", {
@@ -86136,6 +86139,22 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(MorphTarget.prototype, "animationPropertiesOverride", {
+            /**
+             * Gets or sets the animation properties override
+             */
+            get: function () {
+                if (!this._animationPropertiesOverride && this._scene) {
+                    return this._scene.animationPropertiesOverride;
+                }
+                return this._animationPropertiesOverride;
+            },
+            set: function (value) {
+                this._animationPropertiesOverride = value;
+            },
+            enumerable: true,
+            configurable: true
+        });
         Object.defineProperty(MorphTarget.prototype, "hasPositions", {
             /**
              * Gets a boolean defining if the target contains position data
@@ -86262,7 +86281,7 @@ var BABYLON;
             if (!name) {
                 name = mesh.name;
             }
-            var result = new MorphTarget(name, influence);
+            var result = new MorphTarget(name, influence, mesh.getScene());
             result.setPositions(mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind));
             if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) {
                 result.setNormals(mesh.getVerticesData(BABYLON.VertexBuffer.NormalKind));

+ 21 - 2
dist/preview release/babylon.no-module.max.js

@@ -86067,8 +86067,9 @@ var BABYLON;
          */
         function MorphTarget(
         /** defines the name of the target */
-        name, influence) {
+        name, influence, scene) {
             if (influence === void 0) { influence = 0; }
+            if (scene === void 0) { scene = null; }
             this.name = name;
             /**
              * Gets or sets the list of animations
@@ -86081,6 +86082,8 @@ var BABYLON;
              * Observable raised when the influence changes
              */
             this.onInfluenceChanged = new BABYLON.Observable();
+            this._animationPropertiesOverride = null;
+            this._scene = scene || BABYLON.Engine.LastCreatedScene;
             this.influence = influence;
         }
         Object.defineProperty(MorphTarget.prototype, "influence", {
@@ -86103,6 +86106,22 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(MorphTarget.prototype, "animationPropertiesOverride", {
+            /**
+             * Gets or sets the animation properties override
+             */
+            get: function () {
+                if (!this._animationPropertiesOverride && this._scene) {
+                    return this._scene.animationPropertiesOverride;
+                }
+                return this._animationPropertiesOverride;
+            },
+            set: function (value) {
+                this._animationPropertiesOverride = value;
+            },
+            enumerable: true,
+            configurable: true
+        });
         Object.defineProperty(MorphTarget.prototype, "hasPositions", {
             /**
              * Gets a boolean defining if the target contains position data
@@ -86229,7 +86248,7 @@ var BABYLON;
             if (!name) {
                 name = mesh.name;
             }
-            var result = new MorphTarget(name, influence);
+            var result = new MorphTarget(name, influence, mesh.getScene());
             result.setPositions(mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind));
             if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) {
                 result.setNormals(mesh.getVerticesData(BABYLON.VertexBuffer.NormalKind));

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 2 - 2
dist/preview release/babylon.worker.js


+ 21 - 2
dist/preview release/es6.js

@@ -86067,8 +86067,9 @@ var BABYLON;
          */
         function MorphTarget(
         /** defines the name of the target */
-        name, influence) {
+        name, influence, scene) {
             if (influence === void 0) { influence = 0; }
+            if (scene === void 0) { scene = null; }
             this.name = name;
             /**
              * Gets or sets the list of animations
@@ -86081,6 +86082,8 @@ var BABYLON;
              * Observable raised when the influence changes
              */
             this.onInfluenceChanged = new BABYLON.Observable();
+            this._animationPropertiesOverride = null;
+            this._scene = scene || BABYLON.Engine.LastCreatedScene;
             this.influence = influence;
         }
         Object.defineProperty(MorphTarget.prototype, "influence", {
@@ -86103,6 +86106,22 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(MorphTarget.prototype, "animationPropertiesOverride", {
+            /**
+             * Gets or sets the animation properties override
+             */
+            get: function () {
+                if (!this._animationPropertiesOverride && this._scene) {
+                    return this._scene.animationPropertiesOverride;
+                }
+                return this._animationPropertiesOverride;
+            },
+            set: function (value) {
+                this._animationPropertiesOverride = value;
+            },
+            enumerable: true,
+            configurable: true
+        });
         Object.defineProperty(MorphTarget.prototype, "hasPositions", {
             /**
              * Gets a boolean defining if the target contains position data
@@ -86229,7 +86248,7 @@ var BABYLON;
             if (!name) {
                 name = mesh.name;
             }
-            var result = new MorphTarget(name, influence);
+            var result = new MorphTarget(name, influence, mesh.getScene());
             result.setPositions(mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind));
             if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) {
                 result.setNormals(mesh.getVerticesData(BABYLON.VertexBuffer.NormalKind));

+ 6 - 0
dist/preview release/inspector/babylon.inspector.d.ts

@@ -226,6 +226,12 @@ declare module INSPECTOR {
         'PhysicsImpostor': {
             type: typeof BABYLON.PhysicsImpostor;
         };
+        'ImageProcessingConfiguration': {
+            type: typeof BABYLON.ImageProcessingConfiguration;
+        };
+        'ColorCurves': {
+            type: typeof BABYLON.ColorCurves;
+        };
     };
 }
 

+ 6 - 0
dist/preview release/inspector/babylon.inspector.js

@@ -477,6 +477,12 @@ var INSPECTOR;
         'PhysicsImpostor': {
             type: BABYLON.PhysicsImpostor
         },
+        'ImageProcessingConfiguration': {
+            type: BABYLON.ImageProcessingConfiguration
+        },
+        'ColorCurves': {
+            type: BABYLON.ColorCurves
+        }
     };
 })(INSPECTOR || (INSPECTOR = {}));
 

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 4 - 4
dist/preview release/inspector/babylon.inspector.min.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 2 - 2
dist/preview release/viewer/babylon.viewer.js


+ 21 - 2
dist/preview release/viewer/babylon.viewer.max.js

@@ -86188,8 +86188,9 @@ var BABYLON;
          */
         function MorphTarget(
         /** defines the name of the target */
-        name, influence) {
+        name, influence, scene) {
             if (influence === void 0) { influence = 0; }
+            if (scene === void 0) { scene = null; }
             this.name = name;
             /**
              * Gets or sets the list of animations
@@ -86202,6 +86203,8 @@ var BABYLON;
              * Observable raised when the influence changes
              */
             this.onInfluenceChanged = new BABYLON.Observable();
+            this._animationPropertiesOverride = null;
+            this._scene = scene || BABYLON.Engine.LastCreatedScene;
             this.influence = influence;
         }
         Object.defineProperty(MorphTarget.prototype, "influence", {
@@ -86224,6 +86227,22 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(MorphTarget.prototype, "animationPropertiesOverride", {
+            /**
+             * Gets or sets the animation properties override
+             */
+            get: function () {
+                if (!this._animationPropertiesOverride && this._scene) {
+                    return this._scene.animationPropertiesOverride;
+                }
+                return this._animationPropertiesOverride;
+            },
+            set: function (value) {
+                this._animationPropertiesOverride = value;
+            },
+            enumerable: true,
+            configurable: true
+        });
         Object.defineProperty(MorphTarget.prototype, "hasPositions", {
             /**
              * Gets a boolean defining if the target contains position data
@@ -86350,7 +86369,7 @@ var BABYLON;
             if (!name) {
                 name = mesh.name;
             }
-            var result = new MorphTarget(name, influence);
+            var result = new MorphTarget(name, influence, mesh.getScene());
             result.setPositions(mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind));
             if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) {
                 result.setNormals(mesh.getVerticesData(BABYLON.VertexBuffer.NormalKind));

+ 22 - 3
src/Morph/babylon.morphTarget.ts

@@ -9,6 +9,7 @@ module BABYLON {
          */
         public animations = new Array<Animation>();
 
+        private _scene: Nullable<Scene>;
         private _positions: Nullable<FloatArray> = null;
         private _normals: Nullable<FloatArray> = null;
         private _tangents: Nullable<FloatArray> = null;
@@ -39,6 +40,23 @@ module BABYLON {
             }
         }
 
+        
+        private _animationPropertiesOverride: Nullable<AnimationPropertiesOverride> = null;
+
+        /**
+         * Gets or sets the animation properties override
+         */
+        public get animationPropertiesOverride(): Nullable<AnimationPropertiesOverride> {
+            if (!this._animationPropertiesOverride && this._scene) {
+                return this._scene.animationPropertiesOverride;
+            }
+            return this._animationPropertiesOverride;
+        }
+
+        public set animationPropertiesOverride(value: Nullable<AnimationPropertiesOverride>) {
+            this._animationPropertiesOverride = value;
+        }        
+
         /**
          * Creates a new MorphTarget
          * @param name defines the name of the target
@@ -46,8 +64,9 @@ module BABYLON {
          */
         public constructor(
             /** defines the name of the target */
-            public name: string, influence = 0) {
-            this.influence = influence;
+            public name: string, influence = 0, scene: Nullable<Scene> = null) {
+                this._scene = scene || Engine.LastCreatedScene;
+                this.influence = influence;
         }
 
         /**
@@ -186,7 +205,7 @@ module BABYLON {
                 name = mesh.name;
             }
 
-            var result = new MorphTarget(name, influence);
+            var result = new MorphTarget(name, influence, mesh.getScene());
 
             result.setPositions(<FloatArray>mesh.getVerticesData(VertexBuffer.PositionKind));