source: trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.h @ 224

Revision 224, 1.1 KB checked in by mattausch, 19 years ago (diff)

added stuff for bsp tree

Line 
1#ifndef _ViewCell_H__
2#define _ViewCell_H__
3
4#include "Intersectable.h"
5
6class Mesh;
7
8//namespace GtpVisibilityPreprocessor {
9 
10class BspInterior;
11class BspPvs;
12/**
13        View cell represented as a mesh
14*/
15class ViewCell: public Intersectable
16{
17public:
18        /** Default constructor taking a mesh which represents the shape of
19                the viewcell.
20        */
21        ViewCell(Mesh *mesh): mMesh(mesh), mPvs(NULL) {}
22
23        /** Returns pointer to the mesh which represents the shape of the viewcell.
24        */
25        Mesh *GetMesh() {return mMesh;}
26
27        /** Returns pointer to PVS.
28                @returns PVS, i.e., the visible BSP tree nodes.
29        */
30        BspPvs *GetPVS() {return mPvs;}
31
32        AxisAlignedBox3 GetBox()  {return mMesh->mBox;}
33 
34        int CastRay(Ray &ray) {return 0;}
35 
36        bool IsConvex() {return mMesh->mIsConvex;}
37        bool IsWatertight() {return mMesh->mIsWatertight;}
38        float IntersectionComplexity() {return mMesh->mFaces.size();}
39
40        int Type() const { return VIEWCELL; }
41
42        void GetRandomSurfacePoint(Vector3 &point, Vector3 &normal) {point = Vector3(0,0,0);};
43
44protected:
45
46        Mesh *mMesh;
47        /// the PVS (i.e., the visible bsp tree nodes)
48        BspPvs *mPvs;
49
50};
51 
52//}; // GtpVisibilityPreprocessor
53
54#endif
Note: See TracBrowser for help on using the repository browser.