Light implements its own origin

This commit is contained in:
Eryn Wells 2014-07-20 16:51:20 -07:00
parent 19aeb7b14e
commit 12f180a3de
2 changed files with 24 additions and 4 deletions

View file

@ -93,5 +93,20 @@ PointLight::PointLight(const Vector3 &o,
const Color &c,
const float &i)
: AmbientLight(c, i),
Object(o)
mOrigin(o)
{ }
const Vector3&
PointLight::GetOrigin()
const
{
return mOrigin;
}
void
PointLight::SetOrigin(const Vector3& origin)
{
mOrigin = origin;
}

View file

@ -9,7 +9,6 @@
#define __LIGHT_H__
#include "basics.h"
#include "object.h"
class AmbientLight
@ -35,14 +34,20 @@ private:
class PointLight
: public AmbientLight,
public Object
: public AmbientLight
{
public:
PointLight();
PointLight(const Vector3 &o);
PointLight(const Vector3 &o, const Color &c);
PointLight(const Vector3 &o, const Color &c, const float &i);
const Vector3& GetOrigin() const;
void SetOrigin(const Vector3& origin);
private:
Vector3 mOrigin;
};
#endif