charles/src/light.h

54 lines
883 B
C
Raw Normal View History

2013-09-10 21:48:41 -07:00
/* light.h
*
* Lights light the scene.
*
* Eryn Wells <eryn@erynwells.me>
*/
#ifndef __LIGHT_H__
#define __LIGHT_H__
2013-09-11 08:57:05 -07:00
#include "basics.h"
2013-09-10 21:48:41 -07:00
class AmbientLight
2013-09-10 21:48:41 -07:00
{
public:
AmbientLight();
AmbientLight(const Color &c);
AmbientLight(const Color &c, const float &i);
2013-09-10 21:48:41 -07:00
const Color &get_color() const;
const float &get_intensity() const;
void set_intensity(const float &i);
2013-09-10 21:48:41 -07:00
Color compute_color_contribution() const;
protected:
Color color;
2013-09-10 21:48:41 -07:00
float intensity;
private:
void _clamp_intensity();
};
class PointLight
2014-07-20 16:51:20 -07:00
: public AmbientLight
{
public:
PointLight();
2014-07-20 16:51:20 -07:00
PointLight(const Vector3 &o);
PointLight(const Vector3 &o, const Color &c);
PointLight(const Vector3 &o, const Color &c, const float &i);
2014-07-20 16:51:20 -07:00
const Vector3& GetOrigin() const;
void SetOrigin(const Vector3& origin);
private:
Vector3 mOrigin;
2013-09-10 21:48:41 -07:00
};
#endif