improving Ray, Sphere, Solver, Scene a bit
git-svn-id: svn://anubis/fart/trunk@35 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
1 parent
bdb648b84f
commit
73cdd1a5a1
6 files changed
+35
-4
No files matched your search
@@ -4,6 +4,8 @@
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include "BMP.h"
|
||||
#include "shapes/Shape.h"
|
||||
#include "shapes/Sphere.h"
|
||||
using namespace std;
|
||||
|
||||
Scene::Scene(map<string, const char *> options,
|
||||
@@ -50,10 +52,18 @@ Scene::~Scene()
|
||||
{
|
||||
if (m_data != NULL)
|
||||
delete m_data;
|
||||
for (vector<Shape *>::iterator it = m_shapes.begin();
|
||||
it != m_shapes.end();
|
||||
it++)
|
||||
{
|
||||
delete (*it);
|
||||
}
|
||||
}
|
||||
|
||||
void Scene::load(const char * filename)
|
||||
{
|
||||
/* TODO: parse file somehow */
|
||||
m_shapes.push_back(new Sphere(2.0));
|
||||
}
|
||||
|
||||
void Scene::render()
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include "shapes/Shape.h"
|
||||
|
||||
class Scene
|
||||
{
|
||||
@@ -23,6 +25,7 @@ class Scene
|
||||
std::string m_output_file_name;
|
||||
bool m_verbose;
|
||||
unsigned char * m_data;
|
||||
std::vector<Shape *> m_shapes;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user