Subversion Repositories gelsvn

Rev

Rev 299 | Rev 324 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
290 jrf 1
#ifndef __BOUNDINGINODE_H
2
#define __BOUNDINGINODE_H
3
 
309 jab 4
#include "Ray.h"
290 jrf 5
#include "BoundingNode.h"
6
 
291 jrf 7
namespace Geometry
8
{
9
 
290 jrf 10
/** Interior node of bounding box tree. Contains
11
		pointers to left and right tree. */
12
template<class BoxType>
13
class BoundingINode: public BoundingNode<BoxType>
14
{
15
	BoundingNode<BoxType>* left;
16
	BoundingNode<BoxType>* right;
17
 public:
18
 
19
	BoundingINode(const BoxType& box,
20
								BoundingNode<BoxType>* _left,
21
								BoundingNode<BoxType>* _right): 
22
		BoundingNode<BoxType>(box), left(_left), right(_right) {}
23
 
24
	~BoundingINode() {delete left; delete right;}
25
 
26
	bool intersect(const CGLA::Vec3f&,const CGLA::Vec3f&,float&) const; 
309 jab 27
	void intersect(Ray&  r) const; 
290 jrf 28
	int intersect_cnt(const CGLA::Vec3f&,const CGLA::Vec3f&) const;
29
 
30
	const BoundingNode<BoxType>* get_left() const {return left;}
31
	const BoundingNode<BoxType>* get_right() const {return right;}
32
};
33
 
291 jrf 34
}
290 jrf 35
#endif