Rev 299 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#ifndef __GEOMETRY_OBOX__H
#define __GEOMETRY_OBOX__H
#include <iostream>
#include <vector>
#include "Triangle.h"
#include "AABox.h"
namespace Geometry
{
class OBox
{
const CGLA::Mat3x3f R;
const AABox aabox;
public:
OBox() {}
OBox(const CGLA::Mat3x3f& _R, const AABox& _aabox):
R(_R), aabox(_aabox) {}
bool intersect(const CGLA::Vec3f&, const CGLA::Vec3f&) const;
void minmax_sq_dist(const CGLA::Vec3f& p, float& dmin, float& dmax) const;
static OBox box_triangle(const Triangle&);
static OBox box_and_split(const std::vector<Triangle>& invec,
std::vector<Triangle>& lvec,
std::vector<Triangle>& rvec);
const CGLA::Mat3x3f& get_rotation() const { return R; }
const AABox& get_aabox() const { return aabox; }
/* const CGLA::Vec3f& get_pmin() const {assert(0); return CGLA::Vec3f(0);} */
/* const CGLA::Vec3f& get_pmax() const {assert(0); return CGLA::Vec3f(0);} */
};
}
#endif