From f839963622f993037e463b0d306ba07f818825bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 16 Apr 2012 02:25:18 +0200 Subject: [PATCH] Storing Light position as Vector4, not Vector3. Four bytes more, but more convenient when multiplying with camera matrix. --- src/Light.cpp | 2 +- src/Light.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Light.cpp b/src/Light.cpp index a9f424fdc..44b59d546 100644 --- a/src/Light.cpp +++ b/src/Light.cpp @@ -19,7 +19,7 @@ namespace Magnum { void Light::setClean() { if(!isDirty()) return; - _position = absoluteTransformation().at(3).xyz(); + _position = absoluteTransformation().at(3); Object::setClean(); } diff --git a/src/Light.h b/src/Light.h index 1055309be..080c1681f 100644 --- a/src/Light.h +++ b/src/Light.h @@ -39,7 +39,7 @@ class Light: public Object { /** * @brief Light position relative to root object (scene) */ - inline Vector3 position() { + inline Vector4 position() { setClean(); return _position; } @@ -50,7 +50,7 @@ class Light: public Object { void setClean(); private: - Vector3 _position; + Vector4 _position; }; }