Subversion Repositories gelsvn

Rev

Rev 290 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 290 Rev 291
Line 1... Line 1...
1
#include <cfloat>
1
#include <cfloat>
2
#include <queue>
2
#include <queue>
3
#include <algorithm>
3
#include <algorithm>
4
#include <vector>
4
#include <vector>
5
#include <GL/gl.h>
-
 
6
#include "AABox.h"
5
#include "AABox.h"
7
#include "OBox.h"
6
#include "OBox.h"
8
#include "BoundingTree.h"
7
#include "BoundingTree.h"
9
 
8
 
10
using namespace std;
9
using namespace std;
Line 24... Line 23...
24
		return  __a < __b ? __b : __a;
23
		return  __a < __b ? __b : __a;
25
	}
24
	}
26
 
25
 
27
}
26
}
28
 
27
 
-
 
28
namespace Geometry
-
 
29
{
-
 
30
 
29
template<class BoxType>
31
template<class BoxType>
30
bool BoundingTree<BoxType>::intersect(const CGLA::Vec3f& p , const CGLA::Vec3f& dir,
32
bool BoundingTree<BoxType>::intersect(const CGLA::Vec3f& p , const CGLA::Vec3f& dir,
31
																float& tmin) const 
33
																float& tmin) const 
32
{
34
{
33
	return root->intersect(p,dir,tmin);
35
	return root->intersect(p,dir,tmin);
Line 39... Line 41...
39
{
41
{
40
	return root->intersect_cnt(p,dir);
42
	return root->intersect_cnt(p,dir);
41
}
43
}
42
 
44
 
43
template<class BoxType>
45
template<class BoxType>
44
void BoundingTree<BoxType>::draw(int lmax)
-
 
45
 
-
 
46
{
-
 
47
	root->draw(0,lmax);
-
 
48
}
-
 
49
 
-
 
50
template<class BoxType>
-
 
51
void BoundingTree<BoxType>::build(std::vector<Triangle>& triangles)
46
void BoundingTree<BoxType>::build(std::vector<Triangle>& triangles)
52
{
47
{
53
	delete root;
48
	delete root;
54
	root = Node::build(triangles);
49
	root = Node::build(triangles);
55
}
50
}
Line 183... Line 178...
183
	return Q[0].get_dist();
178
	return Q[0].get_dist();
184
}
179
}
185
 
180
 
186
template BoundingTree<AABox>;
181
template BoundingTree<AABox>;
187
template BoundingTree<OBox>;
182
template BoundingTree<OBox>;
-
 
183
 
-
 
184
}
188
 
185