include/scene.h
branchpyrit
changeset 60 a23b5089b9c3
parent 53 228cb8bfdd54
child 69 303583d2fb97
--- a/include/scene.h	Fri Apr 04 13:54:47 2008 +0200
+++ b/include/scene.h	Tue Apr 08 01:05:12 2008 +0200
@@ -295,6 +295,7 @@
 public:
 	Vertex *A, *B, *C;
 
+	Triangle() {};
 	Triangle(Vertex *aA, Vertex *aB, Vertex *aC, Material *amaterial);
 	bool intersect(const Ray &ray, Float &dist) const;
 	bool intersect_all(const Ray &ray, Float dist, vector<Float> &allts) const {return false;};
@@ -307,4 +308,17 @@
 	BBox get_bbox() const;
 };
 
+template <class T> class Array
+{
+	T *array;
+public:
+	Array(int n) { array = new T[n]; };
+	~Array() { delete[] array; };
+	const T &operator[](int i) const { return array[i]; };
+};
+
+typedef Array<Vertex> VertexArray;
+typedef Array<NormalVertex> NormalVertexArray;
+typedef Array<Triangle> TriangleArray;
+
 #endif