StaticPass: fix spot light

cleanup_build_scripts
Kirill Vainer 9 years ago
parent 3f5cc4963e
commit 65b7c205f9
  1. 10
      jme3-core/src/main/java/com/jme3/material/logic/StaticPassLightingLogic.java

@ -156,11 +156,17 @@ public final class StaticPassLightingLogic extends DefaultTechniqueDefLogic {
ColorRGBA color = light.getColor();
Vector3f pos = light.getPosition();
Vector3f dir = light.getDirection();
tempPosition.set(light.getPosition());
tempDirection.set(light.getDirection());
transformPosition(viewMatrix, tempPosition);
transformDirection(viewMatrix, tempDirection);
float invRange = light.getInvSpotRange();
float spotAngleCos = light.getPackedAngleCos();
lightData.setVector4InArray(color.r, color.g, color.b, 1f, index++);
lightData.setVector4InArray(pos.x, pos.y, pos.z, invRange, index++);
lightData.setVector4InArray(dir.x, dir.y, dir.z, spotAngleCos, index++);
lightData.setVector4InArray(tempPosition.x, tempPosition.y, tempPosition.z, invRange, index++);
lightData.setVector4InArray(tempDirection.x, tempDirection.y, tempDirection.z, spotAngleCos, index++);
}
}

Loading…
Cancel
Save