Commits

Michael Ludwig  committed d8cc888

Fix regression in setLightPosition() and setSpotlightDirection()

  • Participants
  • Parent commits 907bf94

Comments (0)

Files changed (1)

File ferox-renderer/src/main/java/com/ferox/renderer/impl/AbstractFixedFunctionRenderer.java

         // set the modelview to the identity matrix, since the subsequent state
         // is modified by the current modelview, but we store them post-transform
         setModelViewMatrix(IDENTITY);
+        flushModelView();
         for (int i = 0; i < f.lights.length; i++) {
             LightState fl = f.lights[i];
             setLightEnabled(i, fl.enabled);
         }
 
         // compute the eye-space light position
-        state.lights[light].position.mul(state.lights[light].position, state.modelView);
+        state.lights[light].position.mul(state.modelView, pos);
         flushModelView();
         glLightPosition(light, pos);
     }
         }
 
         // compute eye-space spotlight direction
-        l.spotlightDirection.transform(state.modelView, l.spotlightDirection, 0);
+        l.spotlightDirection.transform(state.modelView, dir, 0);
         flushModelView();
         glLightDirection(light, dir);
     }