gpuray_glsl
annotate src/scene.h @ 0:f234630e38ff
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 09 Nov 2014 13:03:36 +0200 |
parents | |
children |
rev | line source |
---|---|
nuclear@0 | 1 #ifndef SCENE_H_ |
nuclear@0 | 2 #define SCENE_H_ |
nuclear@0 | 3 |
nuclear@0 | 4 #include <vector> |
nuclear@0 | 5 #include "object.h" |
nuclear@0 | 6 #include "light.h" |
nuclear@0 | 7 #include "camera.h" |
nuclear@0 | 8 #include "texture.h" |
nuclear@0 | 9 |
nuclear@0 | 10 class Scene { |
nuclear@0 | 11 protected: |
nuclear@0 | 12 std::vector<Object*> objects; |
nuclear@0 | 13 std::vector<Light*> lights; |
nuclear@0 | 14 Camera *camera; |
nuclear@0 | 15 |
nuclear@0 | 16 static TargetCamera def_cam; // default camera |
nuclear@0 | 17 |
nuclear@0 | 18 Color bgcolor; |
nuclear@0 | 19 TextureCube *envmap, *envmap_conv; |
nuclear@0 | 20 float fog_start, fog_end; |
nuclear@0 | 21 |
nuclear@0 | 22 public: |
nuclear@0 | 23 Scene(); |
nuclear@0 | 24 virtual ~Scene(); |
nuclear@0 | 25 |
nuclear@0 | 26 virtual bool load(const char *fname); |
nuclear@0 | 27 virtual bool save(const char *fname) const; |
nuclear@0 | 28 |
nuclear@0 | 29 virtual void set_background_color(const Color &color); |
nuclear@0 | 30 virtual void set_fog(float fog_start, float fog_end); |
nuclear@0 | 31 virtual void get_fog(float *fog_start, float *fog_end) const; |
nuclear@0 | 32 |
nuclear@0 | 33 virtual void set_environment_map(TextureCube *map, TextureCube *map_conv = 0); |
nuclear@0 | 34 |
nuclear@0 | 35 virtual void add_object(Object *obj); |
nuclear@0 | 36 virtual Object *get_object(int i) const; |
nuclear@0 | 37 virtual int get_object_count() const; |
nuclear@0 | 38 |
nuclear@0 | 39 virtual void add_light(Light *lt); |
nuclear@0 | 40 virtual Light *get_light(int i) const; |
nuclear@0 | 41 virtual int get_light_count() const; |
nuclear@0 | 42 |
nuclear@0 | 43 virtual void set_camera(Camera *cam); |
nuclear@0 | 44 virtual Camera *get_camera() const; |
nuclear@0 | 45 |
nuclear@0 | 46 virtual bool intersect(const Ray &ray, HitPoint *hit) const; |
nuclear@0 | 47 |
nuclear@0 | 48 virtual Color env_color(const Ray &ray) const; |
nuclear@0 | 49 |
nuclear@0 | 50 virtual void prepare_xform(long msec); |
nuclear@0 | 51 |
nuclear@0 | 52 friend Color trace_ray(const Scene *scn, const Ray &ray, int rdepth); |
nuclear@0 | 53 friend Color shade(const Scene *scn, const Ray &ray, const HitPoint &hit, int rdepth); |
nuclear@0 | 54 }; |
nuclear@0 | 55 |
nuclear@0 | 56 #endif // SCENE_H_ |