Subversion Repositories gelsvn

Rev

Rev 291 | Rev 443 | Go to most recent revision | Details | Compare with Previous | 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
 
291 jrf 8
namespace Geometry
9
{
10
 
290 jrf 11
template<class BoxType>
12
class BoundingTree
13
{
14
 public:
15
 
16
	typedef BoundingNode<BoxType> Node;
17
	typedef BoundingLNode<BoxType> LeafNode;
18
	typedef BoundingINode<BoxType> IntNode;
19
 
20
	Node* root;
21
 
22
 public:
23
 
24
	BoundingTree(): root(0) {}
25
 
26
	~BoundingTree() {delete root;}
27
 
28
	void build(std::vector<Triangle>& triangles);
29
	bool intersect(const CGLA::Vec3f&,const CGLA::Vec3f&,float&) const;
30
	int intersect_cnt(const CGLA::Vec3f&,const CGLA::Vec3f&) const;
31
 
32
	float compute_signed_distance(const CGLA::Vec3f& p,	float=FLT_MAX) const;
33
};
34
 
291 jrf 35
}
290 jrf 36
 
37
#endif