src/kdtree.cc
branchpyrit
changeset 91 9d66d323c354
parent 87 1081e3dd3f3e
child 92 9af5c039b678
--- a/src/kdtree.cc	Tue Apr 29 23:31:08 2008 +0200
+++ b/src/kdtree.cc	Fri May 02 13:27:47 2008 +0200
@@ -3,7 +3,7 @@
  *
  * This file is part of Pyrit Ray Tracer.
  *
- * Copyright 2006, 2007  Radek Brich
+ * Copyright 2006, 2007, 2008  Radek Brich
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -54,7 +54,7 @@
 {
 	KdNode* node; /* pointer to far child */
 	Float t; /* the entry/exit signed distance */
-	Vector3 pb; /* the coordinates of entry/exit point */
+	Vector pb; /* the coordinates of entry/exit point */
 	int prev;
 };
 
@@ -150,7 +150,7 @@
 // export kd-tree as .obj for visualization
 // this would be hard to reconstruct later
 	static ofstream F("kdtree.obj");
-	Vector3 v;
+	Vector v;
 	static int f=0;
 	v.cell[axis] = node->getSplit();
 	v.cell[(axis+1)%3] = bounds.L.cell[(axis+1)%3];
@@ -239,7 +239,7 @@
 	Float splitVal;
 	int axis;
 	static const int mod3[] = {0,1,2,0,1};
-	const Vector3 invdir = 1 / ray.dir;
+	const Vector invdir = 1 / ray.dir;
 	while (node)
 	{
 		/* loop until a leaf is found */
@@ -328,6 +328,7 @@
 	return NULL;
 }
 
+#ifndef NO_SSE
 // stack element for kd-tree traversal (packet version)
 struct StackElem4
 {
@@ -514,6 +515,7 @@
 
 	/* ray leaves the scene */
 }
+#endif
 
 ostream & operator<<(ostream &st, KdNode &node)
 {