rayzor

diff 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 diff
     1.1 --- a/src/light.h	Sun Apr 13 09:54:51 2014 +0300
     1.2 +++ b/src/light.h	Mon Apr 14 07:34:45 2014 +0300
     1.3 @@ -6,21 +6,30 @@
     1.4  
     1.5  class Light : public SceneNode {
     1.6  private:
     1.7 +	float intens;
     1.8  	Vector3 color;
     1.9  	Vector3 atten;
    1.10  
    1.11  public:
    1.12  	Light();
    1.13  
    1.14 +	void set_intensity(float val);
    1.15 +	float get_intensity() const;
    1.16 +
    1.17  	void set_color(const Vector3 &color);
    1.18  	const Vector3 &get_color() const;
    1.19  
    1.20 +	// includes attenuation and intensity
    1.21 +	Vector3 get_color(const Vector3 &pt) const;
    1.22 +
    1.23  	void set_attenuation(const Vector3 &atten);
    1.24  	const Vector3 &get_attenuation() const;
    1.25  
    1.26 +	float calc_attenuation(float d) const;
    1.27 +
    1.28  	void draw() const;
    1.29  
    1.30 -	bool intersect(const Ray &ray, float *dist);
    1.31 +	bool intersect(const Ray &ray, RayHit *hit = 0) const;
    1.32  };
    1.33  
    1.34  #endif	// LIGHT_H_