Move Color over to basics
This commit is contained in:
parent
47ae52ed05
commit
4b396cabe8
5 changed files with 270 additions and 0 deletions
53
src/light.hh
Normal file
53
src/light.hh
Normal file
|
@ -0,0 +1,53 @@
|
|||
/* light.h
|
||||
*
|
||||
* Lights light the scene.
|
||||
*
|
||||
* Eryn Wells <eryn@erynwells.me>
|
||||
*/
|
||||
|
||||
#ifndef __LIGHT_H__
|
||||
#define __LIGHT_H__
|
||||
|
||||
#include "basics.h"
|
||||
|
||||
|
||||
class AmbientLight
|
||||
{
|
||||
public:
|
||||
AmbientLight();
|
||||
AmbientLight(const Color &c);
|
||||
AmbientLight(const Color &c, const float &i);
|
||||
|
||||
const Color &get_color() const;
|
||||
const float &get_intensity() const;
|
||||
void set_intensity(const float &i);
|
||||
|
||||
Color compute_color_contribution() const;
|
||||
|
||||
protected:
|
||||
Color color;
|
||||
float intensity;
|
||||
|
||||
private:
|
||||
void _clamp_intensity();
|
||||
};
|
||||
|
||||
|
||||
class PointLight
|
||||
: 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
|
Loading…
Add table
Add a link
Reference in a new issue