clray
diff src/scene.h @ 54:6a30f27fa1e6
separated the OpenGL visualization and added a CPU raytracing mode
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 10 Sep 2010 16:47:00 +0100 |
parents | 8047637961a2 |
children | 8c858e1a89e8 |
line diff
1.1 --- a/src/scene.h Sun Sep 05 16:43:55 2010 +0100 1.2 +++ b/src/scene.h Fri Sep 10 16:47:00 2010 +0100 1.3 @@ -34,6 +34,10 @@ 1.4 int matid; 1.5 }; 1.6 1.7 +struct Light { 1.8 + float pos[4], color[4]; 1.9 +}; 1.10 + 1.11 class AABBox { 1.12 public: 1.13 float min[4], max[4]; 1.14 @@ -70,6 +74,7 @@ 1.15 1.16 public: 1.17 std::vector<Mesh*> meshes; 1.18 + std::vector<Light> lights; 1.19 std::vector<Material> matlib; 1.20 KDNode *kdtree; 1.21 1.22 @@ -77,11 +82,20 @@ 1.23 ~Scene(); 1.24 1.25 bool add_mesh(Mesh *m); 1.26 + bool add_light(const Light <); 1.27 + 1.28 int get_num_meshes() const; 1.29 + int get_num_lights() const; 1.30 int get_num_faces() const; 1.31 int get_num_materials() const; 1.32 int get_num_kdnodes() const; 1.33 1.34 + Mesh **get_meshes(); 1.35 + const Mesh * const *get_meshes() const; 1.36 + 1.37 + Light *get_lights(); 1.38 + const Light *get_lights() const; 1.39 + 1.40 Material *get_materials(); 1.41 const Material *get_materials() const; 1.42