Browse Source

Spot light : fixed issue that was preventing point lights to work correctly when a spot light is in the scene

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7916 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
rem..om 14 years ago
parent
commit
ae2fda8626
1 changed files with 4 additions and 0 deletions
  1. 4 0
      engine/src/core/com/jme3/material/Material.java

+ 4 - 0
engine/src/core/com/jme3/material/Material.java

@@ -742,6 +742,8 @@ public class Material implements Asset, Cloneable, Savable, Comparable<Material>
 
                     tmpLightPosition.set(dir.getX(), dir.getY(), dir.getZ(), -1);
                     lightPos.setValue(VarType.Vector4, tmpLightPosition);
+                    tmpLightDirection.set(0,0,0,0);
+                    lightDir.setValue(VarType.Vector4, tmpLightDirection);
                     break;
                 case Point:
                     PointLight pl = (PointLight) l;
@@ -750,6 +752,8 @@ public class Material implements Asset, Cloneable, Savable, Comparable<Material>
 
                     tmpLightPosition.set(pos.getX(), pos.getY(), pos.getZ(), invRadius);
                     lightPos.setValue(VarType.Vector4, tmpLightPosition);
+                    tmpLightDirection.set(0,0,0,0);
+                    lightDir.setValue(VarType.Vector4, tmpLightDirection);
                     break;
                 case Spot:
                     SpotLight sl = (SpotLight) l;