Subversion Repositories gelsvn

Rev

Rev 299 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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