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

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

added viewcell loader

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