Преглед изворни кода

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

David Catuhe пре 7 година
родитељ
комит
6bdf4b675b
2 измењених фајлова са 20 додато и 5 уклоњено
  1. 2 1
      dist/preview release/what's new.md
  2. 18 4
      src/Lights/babylon.light.ts

+ 2 - 1
dist/preview release/what's new.md

@@ -5,12 +5,13 @@
 ## Updates
 
 ### Core Engine
-- Added the choice of [forming a closed loop](http://doc.babylonjs.com/how_to/how_to_use_curve3#catmull-rom-spline) to the catamull-rom-spline curve3 ([johnk](https://github.com/babylonjsguide))
+- Add the choice of [forming a closed loop](http://doc.babylonjs.com/how_to/how_to_use_curve3#catmull-rom-spline) to the catamull-rom-spline curve3 ([johnk](https://github.com/babylonjsguide))
 - Add support for specifying the center of rotation to textures ([bghgary](http://www.github.com/bghgary))
 
 ### glTF Loader
   - Add support for KHR_texture_transform ([bghgary](http://www.github.com/bghgary))
 
 ## Bug fixes
+  - Fix ```shadowEnabled``` property on lights. Shadows are not visble anymore when disabled ([sebavan](http://www.github.com/sebavan))
 
 ## Breaking changes

+ 18 - 4
src/Lights/babylon.light.ts

@@ -185,7 +185,6 @@ module BABYLON {
             this._computePhotometricScale();
         };
 
-        
         @serialize()
         private _renderPriority: number;
         /**
@@ -195,12 +194,27 @@ module BABYLON {
         @expandToProperty("_reorderLightsInScene")
         public renderPriority: number = 0;
 
+        @serialize("shadowEnabled")
+        private _shadowEnabled: boolean = true;
         /**
-         * Defines wether or not the shadows are enabled for this light. This can help turning off/on shadow without detaching
+         * Gets wether or not the shadows are enabled for this light. This can help turning off/on shadow without detaching
          * the current shadow generator.
          */
-        @serialize()
-        public shadowEnabled: boolean = true;
+        public get shadowEnabled(): boolean {
+            return this._shadowEnabled;
+        }
+        /**
+         * Sets wether or not the shadows are enabled for this light. This can help turning off/on shadow without detaching
+         * the current shadow generator.
+         */
+        public set shadowEnabled(value: boolean) {
+            if (this._shadowEnabled === value) {
+                return;
+            }
+
+            this._shadowEnabled = value;
+            this._markMeshesAsLightDirty();
+        }
 
         private _includedOnlyMeshes: AbstractMesh[];
         /**