Browse Source

Storing Light position as Vector4, not Vector3.

Four bytes more, but more convenient when multiplying with camera
matrix.
pull/279/head
Vladimír Vondruš 14 years ago
parent
commit
f839963622
  1. 2
      src/Light.cpp
  2. 4
      src/Light.h

2
src/Light.cpp

@ -19,7 +19,7 @@ namespace Magnum {
void Light::setClean() { void Light::setClean() {
if(!isDirty()) return; if(!isDirty()) return;
_position = absoluteTransformation().at(3).xyz(); _position = absoluteTransformation().at(3);
Object::setClean(); Object::setClean();
} }

4
src/Light.h

@ -39,7 +39,7 @@ class Light: public Object {
/** /**
* @brief Light position relative to root object (scene) * @brief Light position relative to root object (scene)
*/ */
inline Vector3 position() { inline Vector4 position() {
setClean(); setClean();
return _position; return _position;
} }
@ -50,7 +50,7 @@ class Light: public Object {
void setClean(); void setClean();
private: private:
Vector3 _position; Vector4 _position;
}; };
} }

Loading…
Cancel
Save