From 858b1e35aed8b3a37f138138910327f7259d1251 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Wed, 3 Oct 2012 00:29:59 +0200 Subject: Spot light angle fix --- src/graphics/core/light.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/graphics/core') 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; } }; -- cgit v1.2.3-1-g7c22 From 6fdaf5de46b8ab29cfb67d49661a63fff5a6995a Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Fri, 5 Oct 2012 18:59:49 +0200 Subject: CParticle rewrite --- src/graphics/core/color.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/graphics/core') diff --git a/src/graphics/core/color.h b/src/graphics/core/color.h index 0bec7e9..7cbd175 100644 --- a/src/graphics/core/color.h +++ b/src/graphics/core/color.h @@ -107,6 +107,14 @@ inline IntColor ColorToIntColor(Color color) static_cast(color.a * 255.0f)); } +inline Color IntensityToColor(float intensity) +{ + if (intensity <= 0.0f) return Color(0.0f, 0.0f, 0.0f, 0.0f); + if (intensity >= 1.0f) return Color(1.0f, 1.0f, 1.0f, 1.0f); + + return Color(intensity, intensity, intensity, intensity); +} + /** * \struct ColorHSV * \brief HSV color -- cgit v1.2.3-1-g7c22