Subversion Repositories gelsvn

Rev

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

#ifndef __BOUNDINGTREE_H
#define __BOUNDINGTREE_H

#include "BoundingNode.h"
#include "BoundingLNode.h"
#include "BoundingINode.h"

template<class BoxType>
class BoundingTree
{
 public:

        typedef BoundingNode<BoxType> Node;
        typedef BoundingLNode<BoxType> LeafNode;
        typedef BoundingINode<BoxType> IntNode;
        
        Node* root;

 public:

        BoundingTree(): root(0) {}

        ~BoundingTree() {delete root;}

        void build(std::vector<Triangle>& triangles);
        void draw(int=1e6);
        bool intersect(const CGLA::Vec3f&,const CGLA::Vec3f&,float&) const;
        int intersect_cnt(const CGLA::Vec3f&,const CGLA::Vec3f&) const;

        float compute_signed_distance(const CGLA::Vec3f& p,     float=FLT_MAX) const;
};



#endif