rayzor

diff src/scene.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 be616b58df99
children 6b11a3f8706e
line diff
     1.1 --- a/src/scene.h	Sun Apr 13 09:54:51 2014 +0300
     1.2 +++ b/src/scene.h	Mon Apr 14 07:34:45 2014 +0300
     1.3 @@ -7,6 +7,9 @@
     1.4  #include "object.h"
     1.5  #include "light.h"
     1.6  #include "camera.h"
     1.7 +#include "raytrace.h"
     1.8 +
     1.9 +enum { SCN_BG_LOW, SCN_BG_MID, SCN_BG_HIGH };
    1.10  
    1.11  class Scene {
    1.12  private:
    1.13 @@ -18,6 +21,10 @@
    1.14  	vector<Camera*> cameras;
    1.15  	Camera *active_cam;
    1.16  
    1.17 +	Vector3 bg[3];
    1.18 +	Vector3 ambient;
    1.19 +	float fog_exp;
    1.20 +
    1.21  	vector<int> sel;
    1.22  
    1.23  public:
    1.24 @@ -29,6 +36,13 @@
    1.25  	void set_name(const char *name);
    1.26  	const char *get_name() const;
    1.27  
    1.28 +	void set_background(const Vector3 &col, int idx = -1);
    1.29 +	const Vector3 &get_background(int idx = -1) const;
    1.30 +	Vector3 get_background(const Ray &ray) const;
    1.31 +
    1.32 +	void set_ambient(const Vector3 &col);
    1.33 +	const Vector3 &get_ambient() const;
    1.34 +
    1.35  	void add(SceneNode *node);
    1.36  
    1.37  	int get_node_count() const;
    1.38 @@ -54,6 +68,8 @@
    1.39  	void clear_selection();
    1.40  	int get_selection_count() const;
    1.41  	int get_selection(int idx = 0) const;
    1.42 +
    1.43 +	bool intersect(const Ray &ray, RayHit *hit = 0) const;
    1.44  };
    1.45  
    1.46  #endif	// SCENE_H_