Ignore:
Timestamp:
06/22/05 10:05:06 (20 years ago)
Author:
mattausch
Message:

fixed bug when canceling login
fixed visibility queries using occlusion queries

Location:
trunk/VUT/GtpVisibility
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibility/include/VisibilityInfo.h

    r144 r145  
    99namespace GtpVisibility { 
    1010   
    11 /** Class storing the visibility information of a scene node.  
     11/** Class storing visibility information. 
    1212*/ 
    13 class NodeInfo  
     13class VisibilityInfo 
    1414{ 
    1515public: 
    16     NodeInfo(HierarchyNode *node, const int projectedPixels, const int visiblePixels):  
    17         mNode(node)//, mProjectedPixels(projectedPixels), mVisiblePixels(visiblePixels)  
    18         {} 
     16        VisibilityInfo(const int visiblePixels, const int projectedPixels); 
    1917 
    20         int GetVisiblePixels() const {return mVisiblePixels;} 
    21         int GetProjectedPixels() const {return mProjectedPixels;} 
     18        int GetVisiblePixels() const; 
     19        int GetProjectedPixels() const; 
    2220 
    23         void SetVisiblePixels(int vis) {mVisiblePixels = vis;} 
    24         void SetProjectedPixels(int vis) {mProjectedPixels = vis;} 
     21        void SetVisiblePixels(int vis); 
     22        void SetProjectedPixels(int vis); 
     23         
     24        /** Computes ratio of visible to projected pixels. */ 
     25        float ComputeRelativeVisibility(); 
    2526 
    26         void SetNode(HierarchyNode *node) {mNode = node;} 
    27         HierarchyNode *GetNode() const {return mNode;} 
     27        /** Adds visibility to current visibility information. 
     28        */ 
     29        void AddVisibility(const VisibilityInfo &info); 
    2830 
    29         float ComputeRelativeVisibility() { float result = mVisiblePixels; if (mProjectedPixels) result /= (float)mProjectedPixels; return result;} 
     31 
     32protected: 
     33        /** number of visible pixels. */ 
     34    int mVisiblePixels; 
     35        /** number of projected pixels */ 
     36        int mProjectedPixels; 
     37}; 
     38/** Class storing the visibility information of a hierarchy node.  
     39*/ 
     40class NodeInfo: public VisibilityInfo 
     41{ 
     42public: 
     43    NodeInfo(HierarchyNode *node, const int visiblePixels, const int projectedPixels); 
     44 
     45        void SetNode(HierarchyNode *node); 
     46        HierarchyNode *GetNode() const; 
    3047        //bool operator<(const NodeInfo& rhs) const {return mNode < rhs.mNode;} 
    3148 
    3249protected: 
    3350 
    34     /** pointer to the scene node */ 
     51    /** Pointer to the hierarchy nnode. 
     52        */ 
    3553    HierarchyNode *mNode; 
    36      
    37     int mVisiblePixels; 
    38         int mProjectedPixels; 
    3954}; 
    4055   
    4156/** Class storing the visibility information of a mesh. 
    4257*/ 
    43 class MeshInfo  
     58class MeshInfo: public VisibilityInfo 
    4459{ 
    4560public: 
    46         MeshInfo(Mesh *mesh,  const int projectedPixels, const int visiblePixels):  
    47         mMesh(mesh), mProjectedPixels(projectedPixels), mVisiblePixels(visiblePixels)  
    48         {} 
     61        MeshInfo(Mesh *mesh, const int visiblePixels, const int projectedPixels); 
    4962 
    50         int GetVisiblePixels() const {return mVisiblePixels;} 
    51         int GetProjectedPixels() const {return mProjectedPixels;} 
     63        Mesh *GetMesh() const; 
     64        void SetMesh(Mesh *mesh); 
    5265 
    53         void SetVisiblePixels(float vis) { mVisiblePixels = vis;} 
    54         void SetProjectedPixels(float vis) { mProjectedPixels = vis;} 
    55  
    56         Mesh *GetMesh() const {return mMesh;} 
    57         void SetMesh(Mesh *mesh) {mMesh = mesh;} 
    58  
    59         bool operator<(const MeshInfo& rhs) const {return mMesh < rhs.mMesh;} 
    60         //bool operator>(const MeshInfo& rhs) const {return mMesh > rhs.mMesh;} 
     66        //bool operator<(const MeshInfo& rhs) const {return mMesh < rhs.mMesh;} 
    6167        //bool operator==(const MeshInfo& rhs) const {return mMesh == rhs.mMesh;} 
    6268         
     
    6672        */ 
    6773    Mesh *mMesh; 
    68    
    69     int mVisiblePixels; 
    70         int mProjectedPixels; 
    7174}; 
    7275   
Note: See TracChangeset for help on using the changeset viewer.