Changeset 418


Ignore:
Timestamp:
11/16/05 18:33:18 (19 years ago)
Author:
mattausch
Message:
 
Location:
trunk/VUT
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env

    r416 r418  
    6868ViewCells { 
    6969        #hierarchy kdTree 
    70         hierarchy vspTree 
     70        #hierarchy vspTree 
    7171        hierarchy bspTree 
    7272        # hierarchy sceneDependent 
     
    133133        #splitPlaneStrategy 130 
    134134         
    135         splitPlaneStrategy 12 
     135        splitPlaneStrategy 1024 
    136136         
    137137        maxPolyCandidates 50 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Exporter.h

    r396 r418  
    1212class KdTree; 
    1313class BspTree; 
     14class VspKdTree; 
    1415class SceneGraphNode; 
    1516class Ray; 
     
    4647  virtual bool 
    4748  ExportKdTree(const KdTree &tree) = 0; 
     49 
     50  virtual bool 
     51  ExportVspKdTree(const VspKdTree &tree) = 0; 
    4852 
    4953  virtual bool 
  • trunk/VUT/GtpVisibilityPreprocessor/src/RenderSimulator.cpp

    r416 r418  
    5454        // probability that view point lies in a view cell 
    5555        float pInVcTotal = 0; 
     56 
    5657        // total probability that a view cell border is crossed 
    57         float pCrossVcTotal = 0; 
     58        const float pCrossVcTotal = mBspTree->GetBoundingBox().SurfaceArea(); 
    5859 
    5960        // collect all view cells 
     
    7879                // compute render time of PVS times probability that view point is in view cell 
    7980                float vcCost = pInVc * RenderPvs(*(*it), mObjRenderCost); 
    80                 Debug << "p: " << pInVc << " rendercost: " << RenderPvs(*(*it), mObjRenderCost) << endl; 
     81                //Debug << "p: " << pInVc << " rendercost: " << RenderPvs(*(*it), mObjRenderCost) << endl; 
    8182                renderTime += vcCost; 
    8283 
     
    8788 
    8889                // probability that a view cell border is crossed 
    89                 float pCrossVc = area; 
     90                float pCrossVc = area * mMoveSpeed; 
    9091 
    9192                // crossing the border of a view cell is also depending on the move speed 
    92                 loadPvsOverhead += pCrossVc * mVcOverhead * mMoveSpeed; 
     93                loadPvsOverhead += pCrossVc * mVcOverhead; 
    9394 
    9495                pInVcTotal += pInVc; 
    95                 pCrossVcTotal += pCrossVc; 
    9696        } 
    9797 
     
    9999        renderTime /= pInVcTotal; 
    100100        loadPvsOverhead /= pCrossVcTotal; 
    101  
    102         Debug << "bsp RT: " << renderTime << endl; 
    103         Debug << "bsp pvsOverhead: " << loadPvsOverhead << endl; 
    104101 
    105102        mStat.avgRtWithoutOverhead = renderTime; 
     
    144141 
    145142        // total probability that a view cell border is crossed 
    146         float pCrossVcTotal = 0; 
     143        const float pCrossVcTotal = mKdTree->GetBox().SurfaceArea(); 
    147144 
    148145        vector<KdLeaf *> leaves; 
     
    165162                        pInVc = box.SurfaceArea(); 
    166163                 
    167                 // probability that a view cell border is crossed 
    168                 const float pCrossVc = box.SurfaceArea(); 
    169  
    170164                float vcCost = pInVc * RenderPvs(*it, mObjRenderCost); 
    171165                renderTime += vcCost; 
     
    176170                        mStat.minCost = vcCost; 
    177171 
    178                 loadPvsOverhead += pCrossVc * mVcOverhead * mMoveSpeed; 
     172                // probability that a view cell border is crossed 
     173                const float pCrossVc = box.SurfaceArea() * mMoveSpeed; 
     174 
     175                loadPvsOverhead += pCrossVc * mVcOverhead; 
    179176 
    180177                pInVcTotal += pInVc; 
    181                 pCrossVcTotal += pCrossVc; 
    182178        } 
    183  
    184         Debug << "RT: " << renderTime << endl; 
    185         Debug << "pvsOverhead: " << loadPvsOverhead << endl; 
    186  
    187179 
    188180        renderTime /= pInVcTotal; 
  • trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp

    r416 r418  
    167167 
    168168int 
    169 SamplingPreprocessor::CastRay(Intersectable *object, 
    170                                                                                                                         Ray &ray 
    171                                                                                                                         ) 
     169SamplingPreprocessor::CastRay(Intersectable *object, Ray &ray) 
    172170{ 
    173171        int sampleContributions = 0; 
     
    520518                } 
    521519                else 
    522                 { 
    523                         Debug << "contr: " << passSampleContributions << " pvs: " << pvsSize << " objects: " << objects.size() << endl; 
    524520                        pvsSize += passSampleContributions; 
    525                 } 
     521                 
    526522                float avgRayContrib = (passContributingSamples > 0) ?  
    527523                        passSampleContributions/(float)passContributingSamples : 0; 
     
    641637                exporter->ExportKdTree(*mKdTree); 
    642638 
    643                 if (mBspTree && (ViewCell::sHierarchy == ViewCell::BSP)) 
    644                         exporter->ExportBspTree(*mBspTree); 
     639                if (mBspTree && (ViewCell::sHierarchy == ViewCell::VSP)) 
     640                        exporter->ExportVspKdTree(*mVspKdTree); 
    645641 
    646642                delete exporter; 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp

    r414 r418  
    14871487 
    14881488                // give penalty to unbalanced split 
     1489                if (0) 
    14891490                if (((pFront * 0.2 + Limits::Small) > pBack) || (pFront < (pBack * 0.2 + Limits::Small))) 
    14901491                        val += 0.5; 
    14911492        } 
    14921493 
    1493         if (0) 
     1494#ifdef _DEBUG 
    14941495        Debug << "totalpvs: " << pvs << " ptotal: " << pOverall 
    14951496                  << " frontpvs: " << frontPvs << " pFront: " << pFront  
    1496                   << " backpvs: " << backPvs << " pBack: " << pBack  
    1497                   << " val " << val << " new size: " << ComputePvsSize(rays)<< endl << endl; 
    1498  
     1497                  << " backpvs: " << backPvs << " pBack: " << pBack << endl << endl; 
     1498#endif 
    14991499        return val; 
    15001500} 
  • trunk/VUT/GtpVisibilityPreprocessor/src/VspKdTree.cpp

    r414 r418  
    2525#include "Ray.h" 
    2626 
    27  
    28 #define DEBUG_DIR_SPLIT 0 
    29  
    30  
    31  
    3227// Static variables 
    33 int 
    34 VspKdTreeLeaf::mailID = 0; 
     28int VspKdTreeLeaf::mailID = 0; 
     29int VspKdTree::sTermMaxDepth = 10; 
     30float VspKdTree::sTermMinSize = 0.1; 
     31int VspKdTree::sTermMinPvs = 10; 
     32int VspKdTree::sTermMinRays = 20; 
     33float VspKdTree::sTermMaxCostRatio = 0.1; 
     34float VspKdTree::sTermMaxRayContribution = 0.1; 
     35 
     36 
    3537 
    3638inline void AddObject2Pvs(Intersectable *object, 
     
    6870} 
    6971 
     72/**************************************************************/ 
     73 *                VspKdTreeInterior implementation            * 
     74/**************************************************************/ 
     75 
     76VspKdTreeInterior::VspKdTreeInterior(VspKdTreeInterior *p): 
     77VspKdTreeNode(p), mBack(NULL), mFront(NULL), mAccesses(0), mLastAccessTime(-1) 
     78{ 
     79} 
     80 
     81int VspKdTreeInterior::GetAccessTime() 
     82{ 
     83        return lastAccessTime; 
     84} 
     85 
     86void VspKdTreeInterior::SetupChildLinks(VspKdTreeNode *b, VspKdTreeNode *f)  
     87{ 
     88        mBack = b; 
     89        mFront = f; 
     90        b->mParent = f->mParent = this; 
     91} 
     92 
     93void VspKdTreeInterior::ReplaceChildLink(VspKdTreeNode *oldChild, VspKdTreeNode *newChild) 
     94{ 
     95        if (mBack == oldChild) 
     96                mBack = newChild; 
     97        else 
     98                mFront = newChild; 
     99} 
     100 
     101int VspKdTreeInterior::Type() const   
     102{  
     103        return VspKdInterior;  
     104} 
     105   
     106VspKdTreeInterior::~VspKdTreeInterior() 
     107{ 
     108        DEL_PTR(mBack); 
     109        DEL_PTR(mFront); 
     110} 
     111   
     112void VspKdTreeInterior::Print(ostream &s) const  
     113{ 
     114        if (axis == 0) 
     115                s << "x "; 
     116        else 
     117                if (axis == 1) 
     118                        s << "y "; 
     119                else 
     120                        s << "z "; 
     121        s << position << " "; 
     122 
     123        mBack->Print(s); 
     124        mFront->Print(s); 
     125} 
     126         
     127int VspKdTreeInterior::ComputeRayIntersection(const RayInfo &rayData, float &t)  
     128{ 
     129        return rayData.ComputeRayIntersection(axis, position, t); 
     130} 
     131 
    70132 
    71133// Constructor 
    72134VspKdTree::VspKdTree() 
    73135{ 
    74         environment->GetIntValue("VspKdTree.maxDepth", termMaxDepth); 
    75         environment->GetIntValue("VspKdTree.minPvs", termMinPvs); 
    76         environment->GetIntValue("VspKdTree.minRays", termMinRays); 
    77         environment->GetFloatValue("VspKdTree.maxRayContribution", termMaxRayContribution); 
    78         environment->GetFloatValue("VspKdTree.maxCostRatio", termMaxCostRatio); 
    79  
    80         environment->GetFloatValue("VspKdTree.minSize", termMinSize); 
     136        environment->GetIntValue("VspKdTree.maxDepth", sTermMaxDepth); 
     137        environment->GetIntValue("VspKdTree.minPvs", sTermMinPvs); 
     138        environment->GetIntValue("VspKdTree.minRays", sTermMinRays); 
     139        environment->GetFloatValue("VspKdTree.maxRayContribution", sTermMaxRayContribution); 
     140        environment->GetFloatValue("VspKdTree.maxCostRatio", sTermMaxCostRatio); 
     141 
     142        environment->GetFloatValue("VspKdTree.minSize", sTermMinSize); 
    81143        termMinSize = sqr(termMinSize); 
    82          
    83         environment->GetFloatValue("VspKdTree.refDirBoxMaxSize", refDirBoxMaxSize); 
    84         refDirBoxMaxSize = sqr(refDirBoxMaxSize); 
    85    
     144           
    86145        environment->GetFloatValue("VspKdTree.epsilon", epsilon); 
    87146        environment->GetFloatValue("VspKdTree.ct_div_ci", ct_div_ci); 
     
    92151   
    93152        float refDirAngle; 
    94         environment->GetFloatValue("VspKdTree.refDirAngle", refDirAngle); 
    95  
    96153        environment->GetIntValue("VspKdTree.accessTimeThreshold", accessTimeThreshold); 
    97154        //= 1000; 
     
    119176        environment->GetBoolValue("VspKdTree.randomize", randomize); 
    120177 
    121         root = NULL; 
     178        mRoot = NULL; 
    122179 
    123180        splitCandidates = new vector<SortableEntry>; 
     
    127184VspKdTree::~VspKdTree() 
    128185{ 
    129         if (root) 
    130                 delete root; 
    131 } 
    132  
    133  
    134  
    135  
    136 void 
    137 VspKdStatistics::Print(ostream &app) const 
     186        if (mRoot) 
     187                delete mRoot; 
     188} 
     189 
     190void VspKdStatistics::Print(ostream &app) const 
    138191{ 
    139192  app << "===== VspKdTree statistics ===============\n"; 
     
    14931546        return sumPvs / (float)leaves; 
    14941547} 
     1548 
     1549VspKdTreeNode *VspKdTree::GetRoot() const 
     1550{ 
     1551        return mRoot; 
     1552} 
     1553 
     1554AxisAlignedBox3 VspKdTree::GetBBox(const VspKdTreeNode *node)  
     1555{ 
     1556        if (node->parent == NULL) 
     1557                return mBbox; 
     1558 
     1559        if (!node->IsLeaf()) 
     1560                return ((VspKdTreeInterior *)node)->mBbox; 
     1561 
     1562        if (node->parent->axis >= 3) 
     1563                return node->parent->mBbox; 
     1564     
     1565        AxisAlignedBox3 box(node->parent->mBbox); 
     1566        if (node->parent->front == node) 
     1567                box.SetMin(node->parent->axis, node->parent->position); 
     1568        else 
     1569                box.SetMax(node->parent->axis, node->parent->position); 
     1570        return mBbox; 
     1571} 
     1572 
     1573int     VspKdTree::GetRootPvsSize() const  
     1574{ 
     1575        return GetPvsSize(mRoot, mBox); 
     1576} 
  • trunk/VUT/GtpVisibilityPreprocessor/src/VspKdTree.h

    r414 r418  
    272272{ 
    273273public: 
    274   // plane in local modelling coordinates 
    275   float position; 
    276  
    277   // pointers to children 
    278   VspKdTreeNode *back, *front; 
    279  
    280   // the bbox of the node 
    281   AxisAlignedBox3 bbox; 
    282  
    283   // the bbox of the node 
    284   AxisAlignedBox3 dirBBox; 
    285    
    286   // data for caching 
    287   long accesses; 
    288   long lastAccessTime; 
    289    
    290   VspKdTreeInterior(VspKdTreeInterior *p):VspKdTreeNode(p), 
    291                                         back(NULL), 
    292                                         front(NULL), 
    293                                         accesses(0), 
    294                                         lastAccessTime(-1) 
    295   { } 
    296  
    297   virtual int GetAccessTime() { 
    298     return lastAccessTime; 
    299   } 
    300  
    301   void SetupChildLinks(VspKdTreeNode *b, VspKdTreeNode *f) { 
    302     back = b; 
    303     front = f; 
    304     b->parent = f->parent = this; 
    305   } 
    306  
    307   void ReplaceChildLink(VspKdTreeNode *oldChild, VspKdTreeNode *newChild) { 
    308     if (back == oldChild) 
    309       back = newChild; 
    310     else 
    311       front = newChild; 
    312   } 
    313  
    314   virtual int Type() const  { return EInterior; } 
    315    
    316   virtual ~VspKdTreeInterior() 
    317   { 
    318           DEL_PTR(back); 
    319           DEL_PTR(front); 
    320   } 
    321    
    322   virtual void Print(ostream &s) const  
    323   { 
    324           if (axis == 0) 
    325                   s << "x "; 
    326           else 
    327                   if (axis == 1) 
    328                           s << "y "; 
    329                   else 
    330                           s << "z "; 
    331           s << position << " "; 
    332           back->Print(s); 
    333           front->Print(s); 
    334   } 
    335          
    336   int ComputeRayIntersection(const RayInfo &rayData, float &t)  
    337   { 
    338           return rayData.ComputeRayIntersection(axis, position, t); 
    339   } 
    340  
     274         
     275        VspKdTreeInterior(VspKdTreeInterior *p); 
     276                         
     277        virtual int GetAccessTime(); 
     278         
     279        virtual int Type(); 
     280   
     281        virtual ~VspKdTreeInterior(); 
     282     
     283        virtual void Print(ostream &s) const; 
     284 
     285protected: 
     286 
     287        void SetupChildLinks(VspKdTreeNode *b, VspKdTreeNode *f); 
     288  
     289        void ReplaceChildLink(VspKdTreeNode *oldChild, VspKdTreeNode *newChild); 
     290  
     291        int ComputeRayIntersection(const RayInfo &rayData, float &t); 
     292 
     293        // plane in local modelling coordinates 
     294        float mPosition; 
     295 
     296        // pointers to children 
     297        VspKdTreeNode *mBack; 
     298        VspKdTreeNode *mFront; 
     299 
     300        // the bbox of the node 
     301        AxisAlignedBox3 mBbox; 
     302 
     303        // data for caching 
     304        long mAccesses; 
     305        long mLastAccessTime; 
    341306}; 
    342307 
     
    543508         
    544509public: 
    545          
    546         ///////////////////////////// 
    547         // The core pointer 
    548         VspKdTreeNode *root; 
    549    
    550         ///////////////////////////// 
    551         // Basic properties 
    552  
    553         // total number of nodes of the tree 
    554         int nodes; 
    555          
    556         // axis aligned bounding box of the scene 
    557         AxisAlignedBox3 bbox; 
    558  
    559         // axis aligned bounding box of directions 
    560         AxisAlignedBox3 dirBBox; 
    561  
    562         const VspKdStatistics &GetStatistics() const { 
    563                 return mStat; 
    564         } 
    565         ///////////////////////////// 
    566         // Construction parameters 
    567  
    568         // epsilon used for the construction 
    569         float epsilon; 
    570  
    571         // ratio between traversal and intersection costs 
    572         float ct_div_ci; 
    573          
    574         // max depth of the tree 
    575         int termMaxDepth; 
    576         // minimal ratio of the volume of the cell and the query volume 
    577         float termMinSize; 
    578  
    579         // minimal pvs per node to still get subdivided 
    580         int termMinPvs; 
    581  
    582         // minimal ray number per node to still get subdivided 
    583         int termMinRays; 
    584          
    585         // maximal cost ration to subdivide a node 
    586         float termMaxCostRatio; 
    587          
    588         // maximal contribution per ray to subdivide the node 
    589         float termMaxRayContribution; 
    590  
    591         // randomized construction 
    592         bool randomize; 
    593  
    594         // type of the splitting to use for the tree construction 
    595         enum {ESplitRegular, ESplitHeuristic }; 
    596         int splitType; 
    597          
    598         // maximal size of the box on which the refdir splitting can be performed 
    599         // (relative to the scene bbox 
    600         float refDirBoxMaxSize; 
    601    
    602         // maximum alovable memory in MB 
    603         float maxTotalMemory; 
    604  
    605         // maximum alovable memory for static kd tree in MB 
    606         float maxStaticMemory; 
    607  
    608         // this is used during the construction depending 
    609         // on the type of the tree and queries... 
    610         float maxMemory; 
    611  
    612         // minimal acess time for collapse 
    613         int accessTimeThreshold; 
    614  
    615         // minimal depth at which to perform collapse 
    616         int minCollapseDepth; 
    617          
    618         // reusable array of split candidates 
    619         vector<SortableEntry> *splitCandidates; 
    620          
    621         ///////////////////////////// 
    622         VspKdStatistics mStat; 
    623          
     510 
    624511        VspKdTree(); 
    625512        virtual ~VspKdTree(); 
     
    697584                                                int &pvsFront); 
    698585 
    699         AxisAlignedBox3 GetBBox(const VspKdTreeNode *node)  
    700         { 
    701                 if (node->parent == NULL) 
    702                         return bbox; 
    703  
    704                 if (!node->IsLeaf()) 
    705                         return ((VspKdTreeInterior *)node)->bbox; 
    706  
    707                 if (node->parent->axis >= 3) 
    708                         return node->parent->bbox; 
    709        
    710                 AxisAlignedBox3 box(node->parent->bbox); 
    711                 if (node->parent->front == node) 
    712                         box.SetMin(node->parent->axis, node->parent->position); 
    713                 else 
    714                         box.SetMax(node->parent->axis, node->parent->position); 
    715                 return box; 
    716         } 
    717  
    718         AxisAlignedBox3 GetDirBBox(const VspKdTreeNode *node)  
    719         { 
    720                 if (node->parent == NULL) 
    721                         return dirBBox; 
    722                 if (!node->IsLeaf()) 
    723                         return ((VspKdTreeInterior *)node)->dirBBox; 
    724                 if (node->parent->axis < 3) 
    725                         return node->parent->dirBBox; 
    726      
    727                 AxisAlignedBox3 dBBox(node->parent->dirBBox); 
    728  
    729                 if (node->parent->front == node) 
    730                         dBBox.SetMin(node->parent->axis - 3, node->parent->position); 
    731                 else 
    732                         dBBox.SetMax(node->parent->axis - 3, node->parent->position); 
    733                 return dBBox; 
    734         } 
    735    
    736         int     ReleaseMemory(const int time); 
    737  
    738         int     CollapseSubtree(VspKdTreeNode *node, const int time); 
    739          
    740         void CountAccess(VspKdTreeInterior *node, const long time)  
    741         { 
    742                 ++ node->accesses; 
    743                 node->lastAccessTime = time; 
    744         } 
     586        AxisAlignedBox3 GetBBox(const VspKdTreeNode *node);      
    745587 
    746588        VspKdTreeNode * SubdivideLeaf(VspKdTreeLeaf *leaf, 
     
    759601 
    760602 
    761         int     GetRootPvsSize() const  
    762         { 
    763                 return GetPvsSize(root, bbox); 
    764         } 
     603        int     GetRootPvsSize() const; 
    765604         
    766605        int     GetPvsSize(VspKdTreeNode *node, const AxisAlignedBox3 &box) const; 
     
    774613 
    775614        float GetAvgPvsSize(); 
     615 
     616        /** Get the root of the tree. 
     617        */ 
     618        VspKdTreeNode *GetRoot() const; 
     619 
     620        int CollapseSubtree(VspKdTreeNode *sroot, const int time); 
     621 
     622        const VspKdStatistics &GetStatistics() const { 
     623                return mStat; 
     624        } 
     625         
     626         
     627        ///////////////////////////// 
     628        // Construction parameters 
     629 
     630        // max depth of the tree 
     631        int sTermMaxDepth; 
     632 
     633        // minimal ratio of the volume of the cell and the query volume 
     634        float sTermMinSize; 
     635 
     636        // minimal pvs per node to still get subdivided 
     637        int sTermMinPvs; 
     638 
     639        // minimal ray number per node to still get subdivided 
     640        int sTermMinRays; 
     641         
     642        // maximal cost ration to subdivide a node 
     643        float sTermMaxCostRatio; 
     644         
     645        // maximal contribution per ray to subdivide the node 
     646        float sTermMaxRayContribution; 
     647 
     648protected: 
     649        ///////////////////////////// 
     650        // The core pointer 
     651        VspKdTreeNode *mRoot; 
     652   
     653        ///////////////////////////// 
     654        // Basic properties 
     655 
     656        // total number of nodes of the tree 
     657        int nodes; 
     658         
     659        // axis aligned bounding box of the scene 
     660        AxisAlignedBox3 mBox; 
     661 
     662        // epsilon used for the construction 
     663        float epsilon; 
     664 
     665        // ratio between traversal and intersection costs 
     666        float ct_div_ci; 
     667         
     668        // type of the splitting to use for the tree construction 
     669        enum {ESplitRegular, ESplitHeuristic }; 
     670        int splitType; 
     671         
     672        // maximum alovable memory in MB 
     673        float maxTotalMemory; 
     674 
     675        // maximum alovable memory for static kd tree in MB 
     676        float maxStaticMemory; 
     677 
     678        // this is used during the construction depending 
     679        // on the type of the tree and queries... 
     680        float maxMemory; 
     681 
     682        // minimal acess time for collapse 
     683        int accessTimeThreshold; 
     684 
     685        // minimal depth at which to perform collapse 
     686        int minCollapseDepth; 
     687         
     688        // reusable array of split candidates 
     689        vector<SortableEntry> *splitCandidates; 
     690         
     691        ///////////////////////////// 
     692        VspKdStatistics mStat;   
    776693}; 
    777694 
  • trunk/VUT/GtpVisibilityPreprocessor/src/X3dExporter.cpp

    r396 r418  
    99#include "Polygon3.h" 
    1010#include "VssRay.h" 
     11#include "VspKdTree.h" 
    1112 
    1213X3dExporter::X3dExporter(const string filename):Exporter(filename) 
     
    580581 
    581582        return true; 
     583} 
     584 
     585bool X3dExporter::ExportVspKdTree(const VspKdTree &tree) 
     586{ 
     587         if (mExportRayDensity)  
     588         { 
     589                 return ExportKdTreeRayDensity(tree); 
     590         } 
     591      
     592         stack<VspKdTreeNode *> tStack; 
     593 
     594         tStack.push(tree.GetRoot()); 
     595 
     596         Mesh *mesh = new Mesh; 
     597   
     598         while (!tStack.empty())  
     599         { 
     600                 VspKdTreeNode *node = tStack.top(); 
     601     
     602                 tStack.pop(); 
     603                 AxisAlignedBox3 box = tree.GetBBox(node); 
     604 
     605                 // add 6 vertices of the box 
     606 
     607                 int index = (int)mesh->mVertices.size(); 
     608    
     609                 for (int i=0; i < 8; ++ i)  
     610                 { 
     611                         Vector3 v; 
     612                         box.GetVertex(i, v); 
     613                         mesh->mVertices.push_back(v); 
     614                 } 
     615 
     616                 mesh->AddFace(new Face(index + 0, index + 1, index + 3, index + 2) ); 
     617                 mesh->AddFace(new Face(index + 0, index + 2, index + 6, index + 4) ); 
     618                 mesh->AddFace(new Face(index + 4, index + 6, index + 7, index + 5) ); 
     619 
     620    
     621                 mesh->AddFace(new Face(index + 3, index + 1, index + 5, index + 7) ); 
     622                 mesh->AddFace(new Face(index + 0, index + 4, index + 5, index + 1) ); 
     623                 mesh->AddFace(new Face(index + 2, index + 3, index + 7, index + 6) ); 
     624 
     625                 if (!node->IsLeaf())  
     626                 { 
     627                         VspKdTreeInterior *interior = dynamic_cast<VspKdTreeInterior *>(node); 
     628                         tStack.push(interior->mFront); 
     629                         tStack.push(interior->mBack); 
     630                 } 
     631         } 
     632   
     633         ExportMesh(mesh); 
     634         DEL_PTR(mesh); 
     635 
     636         return true; 
    582637} 
    583638 
  • trunk/VUT/GtpVisibilityPreprocessor/src/X3dExporter.h

    r396 r418  
    3939  ExportKdTree(const KdTree &tree); 
    4040   
     41  bool  
     42  ExportVspKdTree(const VspKdTree &tree); 
     43 
    4144  bool ExportBspTree(const BspTree &tree); 
    4245 
  • trunk/VUT/Ogre/resources/overlays/VisibilityDemo.overlay

    r343 r418  
    469469                        caption [C] Mesh / Patch visibility (only item buffer) 
    470470                } 
     471                 
    471472                element TextArea(Example/Visibility/Help/SceneObjects): Example/Visibility/Templates/BasicText 
    472473                { 
     
    476477                        caption ******* Generation / Destruction of scene objects ****** 
    477478                } 
     479                element TextArea(Example/Visibility/Help/PlaceObjects): Example/Visibility/Templates/BasicText 
     480                { 
     481                        left 5 
     482                        width 180 
     483                        height 30 
     484                        caption [O] Start / Stop object placing mode 
     485                } 
    478486                element TextArea(Example/Visibility/Help/GenerateObjects): Example/Visibility/Templates/BasicText 
    479487                { 
     
    495503                        width 180 
    496504                        height 30 
    497                         caption [MOUSE LEFT] Drop object on terrain 
     505                        caption [MOUSE LEFT] Drop object on terrain if in object placing mode 
    498506                } 
    499507        } 
  • trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp

    r417 r418  
    231231 
    232232                // get results, create a node/entity on the position 
    233                 mCurrentObject = mTerrainContentGenerator->GenerateSceneObject( 
    234                         mouseRay.getOrigin(), Vector3(val, 0, 0),  
    235                         msObjectCaptions[mCurrentObjectType]); 
     233                mCurrentObject =  
     234                        mTerrainContentGenerator->GenerateSceneObject(mouseRay.getOrigin(),  
     235                                                                                                                  Vector3(val, 0, 0),  
     236                                                                                                                  msObjectCaptions[mCurrentObjectType]); 
    236237                 
    237238                mLMouseDown = true;  
     
    15231524        top += vert_space; 
    15241525        initHelpOverlayElement("SceneObjects", top); top += vert_space; 
     1526        initHelpOverlayElement("PlaceObjects", top); top += vert_space; 
    15251527        initHelpOverlayElement("GenerateObjects", top); top += vert_space; 
    15261528        initHelpOverlayElement("RemoveObjects", top); top += vert_space; 
  • trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.h

    r417 r418  
    176176        mUseBufferedInputMouse = !mUseBufferedInputMouse; 
    177177                mInputDevice->setBufferedInput(true, mUseBufferedInputMouse); 
     178 
     179                if (!mUseBufferedInputMouse) 
     180                        CEGUI::MouseCursor::getSingleton().hide(); 
     181                else 
     182                        CEGUI::MouseCursor::getSingleton().show(); 
    178183        } 
    179184 
  • trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp

    r417 r418  
    378378                                                                           (CEGUI::utf8*)"MouseArrow"); 
    379379 
    380          CEGUI::MouseCursor::getSingleton().show(); 
     380         CEGUI::MouseCursor::getSingleton().hide(); 
    381381} 
    382382//----------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.