#ifndef _ViewCell_H__ #define _ViewCell_H__ #include "Intersectable.h" #include "Containers.h" class Mesh; //namespace GtpVisibilityPreprocessor { class BspInterior; class BspPvs; struct Triangle3; /** View cell represented as a mesh */ class ViewCell: public Intersectable { public: ViewCell(); /** Default constructor taking a mesh which represents the shape of the viewcell. */ ViewCell(Mesh *mesh); /** Returns pointer to the mesh which represents the shape of the viewcell. */ Mesh *GetMesh(); /** Returns pointer to PVS. @returns PVS, i.e., the visible BSP tree nodes. */ BspPvs *GetPVS(); AxisAlignedBox3 GetBox(); int CastRay(Ray &ray); bool IsConvex(); bool IsWatertight(); float IntersectionComplexity(); int Type() const; void GetRandomSurfacePoint(Vector3 &point, Vector3 &normal); /** Derives viewcells from object container. @param objects the intersectables the viewcells are derived from @param viewCells the viewcells are returned in this container @param maxViewCells the maximum number of viewcells created. if 0 => unbounded */ static void DeriveViewCells(const ObjectContainer &objects, ViewCellContainer &viewCells, const int maxViewCells); /** Constructs view cell from base triangle. The ViewCell is extruded along the normal vector. @param the base triangle @param the height of the newly created view cell */ static ViewCell *ExtrudeViewCell(const Triangle3 &baseTri, const float height); protected: /// the mesh defining the geometry of this viewcell Mesh *mMesh; /// the PVS (i.e., the visible bsp tree nodes) BspPvs *mPvs; }; //}; // GtpVisibilityPreprocessor #endif