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

Revision 260, 1.4 KB checked in by mattausch, 19 years ago (diff)

added viewcell stuff

Line 
1#ifndef _ViewCell_H__
2#define _ViewCell_H__
3
4#include "Intersectable.h"
5#include "Containers.h"
6
7class Mesh;
8
9//namespace GtpVisibilityPreprocessor {
10 
11class BspInterior;
12class BspPvs;
13/**
14        View cell represented as a mesh
15*/
16class ViewCell: public Intersectable
17{
18public:
19        /** Default constructor taking a mesh which represents the shape of
20                the viewcell.
21        */
22        ViewCell(Mesh *mesh);
23
24        /** Returns pointer to the mesh which represents the shape of the viewcell.
25        */
26        Mesh *GetMesh();
27
28        /** Returns pointer to PVS.
29                @returns PVS, i.e., the visible BSP tree nodes.
30        */
31        BspPvs *GetPVS();
32
33        AxisAlignedBox3 GetBox();
34 
35        int CastRay(Ray &ray);
36 
37        bool IsConvex();
38        bool IsWatertight();
39        float IntersectionComplexity();
40
41        int Type() const;
42
43        void GetRandomSurfacePoint(Vector3 &point, Vector3 &normal);
44
45        /** Derives viewcells from object container.
46                @param objects the intersectables the viewcells are derived from
47                @param viewCells the viewcells are returned in this container
48                @param maxViewCells if > 0, indicates the maximim number of viewcells that will be created
49        */
50        static void DeriveViewCells(const ObjectContainer &objects,
51                                                                ViewCellContainer &viewCells,
52                                                                const int maxViewCells);
53
54        static ViewCell *Convert2ViewCell(Face *face);
55protected:
56
57        /// the mesh defining the geometry of this viewcell
58        Mesh *mMesh;
59        /// the PVS (i.e., the visible bsp tree nodes)
60        BspPvs *mPvs;
61
62};
63 
64//}; // GtpVisibilityPreprocessor
65
66#endif
Note: See TracBrowser for help on using the repository browser.