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

Revision 268, 1.6 KB checked in by mattausch, 19 years ago (diff)

did bsp 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;
13struct Triangle3;
14/**
15        View cell represented as a mesh
16*/
17class ViewCell: public Intersectable
18{
19public:
20        ViewCell();
21        /** Default constructor taking a mesh which represents the shape of
22                the viewcell.
23        */
24        ViewCell(Mesh *mesh);
25
26        /** Returns pointer to the mesh which represents the shape of the viewcell.
27        */
28        Mesh *GetMesh();
29
30        /** Returns pointer to PVS.
31                @returns PVS, i.e., the visible BSP tree nodes.
32        */
33        BspPvs *GetPVS();
34
35        AxisAlignedBox3 GetBox();
36 
37        int CastRay(Ray &ray);
38 
39        bool IsConvex();
40        bool IsWatertight();
41        float IntersectionComplexity();
42
43        int Type() const;
44
45        void GetRandomSurfacePoint(Vector3 &point, Vector3 &normal);
46
47        /** Derives viewcells from object container.
48                @param objects the intersectables the viewcells are derived from
49                @param viewCells the viewcells are returned in this container
50                @param maxViewCells the maximum number of viewcells created. if 0 => unbounded
51        */
52        static void DeriveViewCells(const ObjectContainer &objects,
53                                                                ViewCellContainer &viewCells,
54                                                                const int maxViewCells);
55
56        /** Constructs view cell from base triangle. The ViewCell is extruded along the normal vector.
57                @param the base triangle
58                @param the height of the newly created view cell
59        */
60        static ViewCell *ExtrudeViewCell(const Triangle3 &baseTri, const float height);
61
62protected:
63
64        /// the mesh defining the geometry of this viewcell
65        Mesh *mMesh;
66        /// the PVS (i.e., the visible bsp tree nodes)
67        BspPvs *mPvs;
68
69};
70
71//}; // GtpVisibilityPreprocessor
72
73#endif
Note: See TracBrowser for help on using the repository browser.