projects
/
MicroTrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed Box::Extend(Vec3f&)
[MicroTrace.git]
/
Scene.hxx
diff --git
a/Scene.hxx
b/Scene.hxx
index
74154eb
..
baafce6
100644
(file)
--- a/
Scene.hxx
+++ b/
Scene.hxx
@@
-2,6
+2,9
@@
#define SCENE_HXX
#include <vector>
#define SCENE_HXX
#include <vector>
+#include <string>
+#include <fstream>
+
#include "Ray.hxx"
#include "Camera.hxx"
#include "Ray.hxx"
#include "Camera.hxx"
@@
-13,7
+16,7
@@
class Scene
public:
Scene();
virtual ~Scene();
public:
Scene();
virtual ~Scene();
-
+
// add another primitive to the scene
void Add(Primitive* p);
// add another light source to the scene
// add another primitive to the scene
void Add(Primitive* p);
// add another light source to the scene
@@
-23,22
+26,49
@@
public:
virtual bool Intersect(Ray& ray);
// find occluder
virtual bool Occluded(Ray& ray);
virtual bool Intersect(Ray& ray);
// find occluder
virtual bool Occluded(Ray& ray);
-
+
// trace the given ray and shade it, returnt the color of the shaded ray
Vec3f RayTrace(Ray& ray);
// trace the given ray and shade it, returnt the color of the shaded ray
Vec3f RayTrace(Ray& ray);
+
+ // acces to camera and light sources
+ const Camera* camera() const;
+ std::vector<Light*> lights() const;
- const Camera* camera() const;
- // lights
- std::vector<Light*> m_lights;
+ // set new camera
+ void setCamera(const Camera* camera);
+
+ // reads in a scene description
+ void ParseOBJ(const std::string& file, float factor);
+ // calculate scene bounding box
+ void CalcBounds();
+
+ const Box& GetSceneBox() const;
private:
Scene(const Scene& );
Scene& operator=(const Scene& );
private:
Scene(const Scene& );
Scene& operator=(const Scene& );
+ void parseOBJLine(const std::string& line);
+ void parseVertex(std::istringstream& iss);
+ void parseFace(std::istringstream& iss);
+ void buildTriangleList(float scale);
+
Camera* m_camera;
// background color
Vec3f m_bgColor;
Camera* m_camera;
// background color
Vec3f m_bgColor;
-
+
// primitives
std::vector<Primitive*> m_primitives;
// primitives
std::vector<Primitive*> m_primitives;
+ // lights
+ std::vector<Light*> m_lights;
+
+ // shader used by loading routine
+ Shader* m_shader;
+
+ // storage for vertices and face indices
+ std::vector<Vec3f> m_vertices, m_faces;
+ Vec3f m_centroid;
+
+ // scene bounding box
+ Box m_scene_box;
};
#endif
};
#endif
This page took
0.027708 seconds
and
4
git commands to generate.