Adjusted point light cutoff level

Corrected directional light post-rotation
Fixed engine parameter value mapping

--HG--
extra : convert_revision : svn%3A7752d6cf-9f14-4ad2-affc-04f1e67b81a5/trunk%4057
This commit is contained in:
kearwood
2012-05-11 01:06:29 +00:00
parent dfdc8c69b8
commit 0b76fadeef
7 changed files with 13 additions and 10 deletions

View File

@@ -28,12 +28,16 @@ std::string KRDirectionalLight::getElementName() {
}
KRVector3 KRDirectionalLight::getWorldLightDirection() {
const GLfloat PI = 3.14159265;
const GLfloat d2r = PI * 2 / 360;
KRVector3 world_rotation = getLocalRotation();
KRVector3 light_rotation = KRVector3(0.0, 0.0, 1.0);
KRVector3 light_rotation = KRVector3(0.0, 0.0, -1.0);
KRMat4 m;
m.rotate(world_rotation.x, X_AXIS);
m.rotate(world_rotation.y, Y_AXIS);
m.rotate(world_rotation.z, Z_AXIS);
m.rotate(world_rotation.z, X_AXIS);
m.rotate(-90.0 * d2r, Y_AXIS);
KRVector3 light_direction = m.dot(light_rotation);
return light_direction;
}