Subversion Repositories gelsvn

Rev

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

Rev Author Line No. Line
290 jrf 1
#ifndef __OBOX__H
2
#define __OBOX__H
3
 
4
#include <iostream>
5
#include <vector>
6
#include "Triangle.h"
7
#include "AABox.h"
8
 
291 jrf 9
namespace Geometry
10
{
11
 
290 jrf 12
class OBox
13
{
14
	const CGLA::Mat3x3f R;
15
	const AABox aabox;
16
 
17
public:
18
	OBox() {}
19
 
20
	OBox(const CGLA::Mat3x3f& _R, const AABox& _aabox):
21
		R(_R), aabox(_aabox) {}
22
 
23
	bool intersect(const CGLA::Vec3f&, const CGLA::Vec3f&) const;
24
 
25
	void minmax_sq_dist(const CGLA::Vec3f& p, float& dmin, float& dmax) const;
26
 
27
	static OBox box_triangle(const Triangle&);
28
 
29
	static OBox box_and_split(const std::vector<Triangle>& invec,
30
														 std::vector<Triangle>& lvec,
31
														 std::vector<Triangle>& rvec);
32
 
291 jrf 33
	const CGLA::Mat3x3f& get_rotation() const { return R; }
34
	const AABox& get_aabox() const { return aabox; }
290 jrf 35
 
36
/* 	const CGLA::Vec3f& get_pmin() const {assert(0); return CGLA::Vec3f(0);} */
37
 
38
/* 	const CGLA::Vec3f& get_pmax() const {assert(0); return CGLA::Vec3f(0);} */
39
 
40
};
41
 
291 jrf 42
}
290 jrf 43
#endif