dungeon_crawler

annotate prototype/src/light.h @ 16:91180ee7b7d9

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 20 Aug 2012 03:40:51 +0300
parents
children 0588f8a1a351
rev   line source
nuclear@4 1 #ifndef LIGHT_H_
nuclear@4 2 #define LIGHT_H_
nuclear@4 3
nuclear@4 4 #include "color.h"
nuclear@4 5
nuclear@4 6 class Light {
nuclear@4 7 protected:
nuclear@4 8 float intensity;
nuclear@4 9 Color color;
nuclear@4 10
nuclear@4 11 public:
nuclear@4 12 Light(const Color &col = 1.0);
nuclear@4 13 virtual ~Light();
nuclear@4 14
nuclear@4 15 virtual void set_intensity(float val);
nuclear@4 16 virtual void set_color(const Color &col);
nuclear@4 17
nuclear@4 18 virtual void use(int id = 0) const;
nuclear@4 19 };
nuclear@4 20
nuclear@4 21 class PointLight : public Light {
nuclear@4 22 protected:
nuclear@4 23 Vector3 pos;
nuclear@4 24 float atten[3];
nuclear@4 25
nuclear@4 26 public:
nuclear@4 27 PointLight();
nuclear@4 28 PointLight(const Vector3 &pos, const Color &col = 1.0);
nuclear@4 29
nuclear@4 30 void set_position(const Vector3 &pos);
nuclear@4 31 void set_attenuation(float att_const, float att_lin, float att_quad);
nuclear@4 32
nuclear@4 33 virtual void use(int id = 0) const;
nuclear@4 34 };
nuclear@4 35
nuclear@4 36 class DirLight : public Light {
nuclear@4 37 protected:
nuclear@4 38 Vector3 dir;
nuclear@4 39
nuclear@4 40 public:
nuclear@4 41 DirLight();
nuclear@4 42 DirLight(const Vector3 &dir, const Color &col = 1.0);
nuclear@4 43
nuclear@4 44 void set_direction(const Vector3 &dir);
nuclear@4 45
nuclear@4 46 virtual void use(int id = 0) const;
nuclear@4 47 };
nuclear@4 48
nuclear@4 49
nuclear@4 50 void set_light(int id, const Light *lt);
nuclear@4 51
nuclear@4 52
nuclear@4 53 #endif // LIGHT_H_