Subversion Repositories gelsvn

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#ifndef __OBOX__H
#define __OBOX__H

#include <iostream>
#include <vector>
#include "Triangle.h"
#include "AABox.h"

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 gl_draw() 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::Vec3f& get_pmin() const {assert(0); return CGLA::Vec3f(0);} */

/*      const CGLA::Vec3f& get_pmax() const {assert(0); return CGLA::Vec3f(0);} */

};

#endif