浏览代码

Fixed typo in Oimo plugin
Fixed dispose bug when a mesh was used by a shadow generator

David Catuhe 9 年之前
父节点
当前提交
a24403ae36

文件差异内容过多而无法显示
+ 13 - 13
dist/preview release/babylon.core.js


文件差异内容过多而无法显示
+ 2936 - 2936
dist/preview release/babylon.d.ts


文件差异内容过多而无法显示
+ 13 - 13
dist/preview release/babylon.js


文件差异内容过多而无法显示
+ 12 - 4
dist/preview release/babylon.max.js


文件差异内容过多而无法显示
+ 13 - 13
dist/preview release/babylon.noworker.js


+ 8 - 0
src/Mesh/babylon.abstractMesh.js

@@ -997,6 +997,14 @@ var BABYLON;
                 if (meshIndex !== -1) {
                     light.excludedMeshes.splice(meshIndex, 1);
                 }
+                // Shadow generators
+                var generator = light.getShadowGenerator();
+                if (generator) {
+                    meshIndex = generator.getShadowMap().renderList.indexOf(_this);
+                    if (meshIndex !== -1) {
+                        generator.getShadowMap().renderList.splice(meshIndex, 1);
+                    }
+                }
             });
             // Edges
             if (this._edgesRenderer) {

+ 10 - 0
src/Mesh/babylon.abstractMesh.ts

@@ -1162,6 +1162,16 @@
                 if (meshIndex !== -1) {
                     light.excludedMeshes.splice(meshIndex, 1);
                 }
+
+                // Shadow generators
+                var generator = light.getShadowGenerator();
+                if (generator) {
+                    meshIndex = generator.getShadowMap().renderList.indexOf(this);
+
+                    if (meshIndex !== -1) {
+                        generator.getShadowMap().renderList.splice(meshIndex, 1);
+                    }
+                }
             });
 
             // Edges

+ 2 - 2
src/Physics/Plugins/babylon.oimoJSPlugin.js

@@ -307,9 +307,9 @@ var BABYLON;
             impostor.physicsBody.awake();
         };
         OimoJSPlugin.prototype.updateDistanceJoint = function (joint, maxDistance, minDistance) {
-            joint.physicsJoint.limitMotoe.upperLimit = maxDistance;
+            joint.physicsJoint.limitMotor.upperLimit = maxDistance;
             if (minDistance !== void 0) {
-                joint.physicsJoint.limitMotoe.lowerLimit = minDistance;
+                joint.physicsJoint.limitMotor.lowerLimit = minDistance;
             }
         };
         OimoJSPlugin.prototype.setMotor = function (joint, speed, maxForce, motorIndex) {

+ 2 - 2
src/Physics/Plugins/babylon.oimoJSPlugin.ts

@@ -365,9 +365,9 @@ module BABYLON {
         }
 
         public updateDistanceJoint(joint: IMotorEnabledJoint, maxDistance: number, minDistance?: number) {
-            joint.physicsJoint.limitMotoe.upperLimit = maxDistance;
+            joint.physicsJoint.limitMotor.upperLimit = maxDistance;
             if (minDistance !== void 0) {
-                joint.physicsJoint.limitMotoe.lowerLimit = minDistance;
+                joint.physicsJoint.limitMotor.lowerLimit = minDistance;
             }
         }