Ignore:
Timestamp:
09/03/06 03:13:29 (18 years ago)
Author:
mattausch
Message:

started osp mesh construction for obj files. Introduced new primitive faceintersectable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.cpp

    r1292 r1314  
    1313#include "Environment.h" 
    1414#include "ResourceManager.h" 
    15  
     15#include "KdIntersectable.h" 
    1616 
    1717 
     
    9393 
    9494                        // correct face index (nust be relative to start of verices) 
    95                         (*vit) = distance(hashTable.begin(), hit); 
     95                        (*vit) = (int)distance(hashTable.begin(), hit); 
    9696                        //Debug << "new idx: " << (*vit) << endl; 
    9797                } 
     
    185185                                Face *face = LoadFace(str, vertices, hashTable); 
    186186                                if (!face) break; 
    187                                  
     187#if 1 
    188188                                faces.push_back(face); 
    189  
    190189                                if (faces.size() >= nMaxFaces) 
    191190                                { 
     
    197196                                         
    198197                                        if (parents)  
    199                                           { 
    200198                                                AssociateFacesWithInstance(mi, *parents); 
    201                                           } 
    202                                          
     199                                                                                 
    203200                                        // reset tables 
    204201                                        hashTable.clear(); 
    205202                                        faces.clear(); 
    206203                                } 
     204#else 
     205                                root->mGeometry.push_back(new FaceIntersectable(face)); 
     206                                hashTable.clear(); 
     207#endif 
    207208                                break; 
    208                         }      // end face 
     209                        }   // end face 
    209210                default: 
    210211                        break; 
    211212                } 
    212  
    213213        } 
    214214 
    215215        // there could be faces remaining 
    216         if (1 && !faces.empty()) 
     216        if (!faces.empty()) 
    217217        {        
    218218                Mesh *mesh = CreateMesh(faces, hashTable); 
     
    222222                 
    223223                if (parents)  
    224                 { 
    225224                        AssociateFacesWithInstance(mi, *parents); 
    226                 } 
    227  
     225                 
    228226                root->mGeometry.push_back(mi);   
    229227        } 
Note: See TracChangeset for help on using the changeset viewer.