Subversion Repositories gelsvn

Rev

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

Rev Author Line No. Line
443 jab 1
#ifndef __GEOMETRY_OBOX__H
2
#define __GEOMETRY_OBOX__H
290 jrf 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
 
460 jab 25
	void minmax_sq_dist(const CGLA::Vec3f& p, float& dmin, float& dmax) const
26
	{
27
		aabox.minmax_sq_dist(R * p, dmin, dmax);
28
	}
29
 
290 jrf 30
 
31
	static OBox box_triangle(const Triangle&);
32
 
33
	static OBox box_and_split(const std::vector<Triangle>& invec,
34
														 std::vector<Triangle>& lvec,
35
														 std::vector<Triangle>& rvec);
36
 
291 jrf 37
	const CGLA::Mat3x3f& get_rotation() const { return R; }
38
	const AABox& get_aabox() const { return aabox; }
290 jrf 39
 
40
/* 	const CGLA::Vec3f& get_pmin() const {assert(0); return CGLA::Vec3f(0);} */
41
 
42
/* 	const CGLA::Vec3f& get_pmax() const {assert(0); return CGLA::Vec3f(0);} */
43
 
44
};
45
 
291 jrf 46
}
290 jrf 47
#endif