shapes/Shape.h now including specific shape headers (after base class definition), test/tests.cc fixed compiler warning, main/Scene drawing demo Plane, util/Transform not needlessly re-initializing m_matrix

git-svn-id: svn://anubis/fart/trunk@62 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
Josh Holtrop 2009-01-28 21:41:19 +00:00
parent a52b456bfa
commit 9041ec6a1c
4 changed files with 7 additions and 3 deletions

View File

@ -10,7 +10,6 @@
#include <math.h> #include <math.h>
#include "BMP.h" #include "BMP.h"
#include "shapes/Shape.h" #include "shapes/Shape.h"
#include "shapes/Sphere.h"
#include "PointLight.h" #include "PointLight.h"
using namespace std; using namespace std;
@ -86,6 +85,9 @@ Scene::~Scene()
void Scene::load(const char * filename) void Scene::load(const char * filename)
{ {
/* TODO: parse file somehow */ /* TODO: parse file somehow */
Shape * plane = new Plane(0, 0, 1, -2);
m_shapes.push_back(plane);
Shape * shape = new Sphere(1.0); Shape * shape = new Sphere(1.0);
m_transform.translate(1.0, 5.0, 0.5); m_transform.translate(1.0, 5.0, 0.5);
shape->setTransform(m_transform); shape->setTransform(m_transform);

View File

@ -32,5 +32,8 @@ class Shape
double m_transparency; double m_transparency;
}; };
#include "Sphere.h"
#include "Plane.h"
#endif #endif

View File

@ -12,7 +12,7 @@ int main()
Shape::IntersectList res = s.intersect(ray); Shape::IntersectList res = s.intersect(ray);
for (int i = 0; i < res.size(); i++) for (unsigned int i = 0; i < res.size(); i++)
{ {
cout << "t: " << res[i] << endl; cout << "t: " << res[i] << endl;
} }

View File

@ -4,7 +4,6 @@
Transform::Transform() Transform::Transform()
{ {
m_matrix = Matrix::identity();
} }
Transform Transform::getInverse() Transform Transform::getInverse()