Browse Source

Storing Light position as Vector4, not Vector3.

Four bytes more, but more convenient when multiplying with camera
matrix.
vectorfields
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() {
if(!isDirty()) return;
_position = absoluteTransformation().at(3).xyz();
_position = absoluteTransformation().at(3);
Object::setClean();
}

4
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;
};
}

Loading…
Cancel
Save