diff options
Diffstat (limited to 'src/graphics')
-rw-r--r-- | src/graphics/core/light.h | 4 | ||||
-rw-r--r-- | src/graphics/opengl/gldevice.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/graphics/core/light.h b/src/graphics/core/light.h index 35f37e6..28733c1 100644 --- a/src/graphics/core/light.h +++ b/src/graphics/core/light.h @@ -68,7 +68,7 @@ struct Light float attenuation1; //! Quadratic attenuation factor float attenuation2; - //! Angle of spotlight cone (0-90 degrees) + //! Angle of spotlight cone (0-PI/2 radians) float spotAngle; //! Intensity of spotlight (0 = uniform; 128 = most intense) @@ -91,7 +91,7 @@ struct Light direction = Math::Vector(0.0f, 0.0f, 1.0f); attenuation0 = 1.0f; attenuation1 = attenuation2 = 0.0f; - spotAngle = 90.0f; + spotAngle = Math::PI/2.0f; spotIntensity = 0.0f; } }; diff --git a/src/graphics/opengl/gldevice.cpp b/src/graphics/opengl/gldevice.cpp index dbf91c7..7bfd843 100644 --- a/src/graphics/opengl/gldevice.cpp +++ b/src/graphics/opengl/gldevice.cpp @@ -305,7 +305,7 @@ void CGLDevice::SetLight(int index, const Light &light) if (light.type == LIGHT_SPOT) { - glLightf(GL_LIGHT0 + index, GL_SPOT_CUTOFF, light.spotAngle); + glLightf(GL_LIGHT0 + index, GL_SPOT_CUTOFF, light.spotAngle * Math::RAD_TO_DEG); glLightf(GL_LIGHT0 + index, GL_SPOT_EXPONENT, light.spotIntensity); } else |