rayzor

view src/light.h @ 17:79609d482762

the renderer renders, also fixed an unnoticed matrix conversion problem between scenegraph and min3d
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 14 Apr 2014 07:34:45 +0300
parents 964f8ea5f095
children 859ccadca671
line source
1 #ifndef LIGHT_H_
2 #define LIGHT_H_
4 #include "vmath.h"
5 #include "snode.h"
7 class Light : public SceneNode {
8 private:
9 float intens;
10 Vector3 color;
11 Vector3 atten;
13 public:
14 Light();
16 void set_intensity(float val);
17 float get_intensity() const;
19 void set_color(const Vector3 &color);
20 const Vector3 &get_color() const;
22 // includes attenuation and intensity
23 Vector3 get_color(const Vector3 &pt) const;
25 void set_attenuation(const Vector3 &atten);
26 const Vector3 &get_attenuation() const;
28 float calc_attenuation(float d) const;
30 void draw() const;
32 bool intersect(const Ray &ray, RayHit *hit = 0) const;
33 };
35 #endif // LIGHT_H_