Subversion Repositories gelsvn

Rev

Rev 291 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
290 jrf 1
#ifndef __BOUNDINGTREE_H
2
#define __BOUNDINGTREE_H
3
 
4
#include "BoundingNode.h"
5
#include "BoundingLNode.h"
6
#include "BoundingINode.h"
7
 
8
template<class BoxType>
9
class BoundingTree
10
{
11
 public:
12
 
13
	typedef BoundingNode<BoxType> Node;
14
	typedef BoundingLNode<BoxType> LeafNode;
15
	typedef BoundingINode<BoxType> IntNode;
16
 
17
	Node* root;
18
 
19
 public:
20
 
21
	BoundingTree(): root(0) {}
22
 
23
	~BoundingTree() {delete root;}
24
 
25
	void build(std::vector<Triangle>& triangles);
26
	void draw(int=1e6);
27
	bool intersect(const CGLA::Vec3f&,const CGLA::Vec3f&,float&) const;
28
	int intersect_cnt(const CGLA::Vec3f&,const CGLA::Vec3f&) const;
29
 
30
	float compute_signed_distance(const CGLA::Vec3f& p,	float=FLT_MAX) const;
31
};
32
 
33
 
34
 
35
#endif