Ignore:
Timestamp:
04/27/06 12:01:26 (18 years ago)
Author:
gumbau
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodStripsConstructor.cpp

    r774 r841  
    484484LodStripsConstructor::LodStripsConstructor(const Mesh                                           *m, 
    485485                                                                                                                const MeshSimplificationSequence        *ms, 
     486                                                                                                                        size_t                                                                                                          submesh, 
    486487                                                                                                                        TIPOFUNC                                                                                                        upb) 
    487488{ 
     
    493494        this->geoMeshSQ = ms; 
    494495 
     496        //      Set the leaves submesh. 
     497        mSubMeshLeaves  =       submesh; 
     498 
     499         
    495500        this->GenerarModeloCompleto(upb); 
    496501} 
     
    784789                        } 
    785790                } 
    786  
    787791        } 
    788792 
     
    10121016                        { 
    10131017                                for     (       j = 0; 
    1014                                                         j < this->geoMesh->mSubMesh[i].mVertexBuffer->mVertexCount; 
    1015                                                         j++) 
     1018                                                j < this->geoMesh->mSubMesh[i].mVertexBuffer->mVertexCount; 
     1019                                                j++) 
    10161020                                { 
    10171021                                        //      Si hay mas de un submesh ListaIndices  
    10181022                                        //      no se rellena correctamente. 
    10191023                                        vAux.Vertex[0] = this->geoMesh->mSubMesh[i]. 
    1020                                                                                                                                                                         mVertexBuffer->mPosition[j].x; 
     1024                                                mVertexBuffer->mPosition[j].x; 
    10211025                                        vAux.Vertex[1] = this->geoMesh->mSubMesh[i]. 
    1022                                                                                                                                                                         mVertexBuffer->mPosition[j].y; 
     1026                                                mVertexBuffer->mPosition[j].y; 
    10231027                                        vAux.Vertex[2] = this->geoMesh->mSubMesh[i]. 
    1024                                                                                                                                                                         mVertexBuffer->mPosition[j].z; 
     1028                                                mVertexBuffer->mPosition[j].z; 
    10251029                                        //      Añadimos las normales en cVerts. 
    10261030                                        vAux.Normal[0] = this->geoMesh->mSubMesh[i]. 
    1027                                                                                                                                                                         mVertexBuffer->mNormal[j].x; 
     1031                                                mVertexBuffer->mNormal[j].x; 
    10281032                                        vAux.Normal[1] = this->geoMesh->mSubMesh[i]. 
    1029                                                                                                                                                                         mVertexBuffer->mNormal[j].y; 
     1033                                                mVertexBuffer->mNormal[j].y; 
    10301034                                        vAux.Normal[2] = this->geoMesh->mSubMesh[i]. 
    1031                                                                                                                                                                         mVertexBuffer->mNormal[j].z; 
     1035                                                mVertexBuffer->mNormal[j].z; 
    10321036 
    10331037                                        //      Añadimos las coordenadas de textura a cVerts. 
    10341038                                        vAux.TexCoords[0]       =       this->geoMesh->mSubMesh[i]. 
    1035                                                                                                                                                                                         mVertexBuffer->mTexCoords[j].x; 
     1039                                                mVertexBuffer->mTexCoords[j].x; 
    10361040                                        vAux.TexCoords[1] = this->geoMesh->mSubMesh[i]. 
    1037                                                                                                                                                                                         mVertexBuffer->mTexCoords[j].y; 
     1041                                                mVertexBuffer->mTexCoords[j].y; 
    10381042 
    10391043                                        vAux.Next                       =       -10; 
    10401044                                        vAux.numMesh    =       i; 
    1041                                          
     1045 
    10421046                                        this->cVerts.push_back(vAux); 
    10431047                                } 
     
    10521056                for     (i = 0; i < this->geoMesh->mSubMeshCount; i++) 
    10531057                { 
    1054                         indice_acum     =       0; 
    1055                          
    1056                         for     (j = 0; j < this->geoMesh->mSubMesh[i].mStripCount; j++) 
    1057                         { 
    1058                                 Index   *aux    =       this->geoMesh->mSubMesh[i].mStrip[j]; 
    1059                                  
    1060                                 if (j != 0) 
    1061                                 { 
    1062                                         // La primera tira no empieza por índices repetidos. 
    1063                                         aux     =       aux+1; 
    1064                                          
    1065                                         indice_acum++; 
    1066                                 } 
    1067                                  
    1068                                 if (j+1 < this->geoMesh->mSubMesh[i].mStripCount) 
    1069                                 { 
    1070                                         Index   *siguiente      =       this->geoMesh->mSubMesh[i].mStrip[j+1]; 
    1071                                          
    1072                                         tira.clear(); 
    1073                                          
    1074                                         while (aux != siguiente) 
    1075                                         { 
    1076                                                 tira.push_back(*aux); 
     1058                        //      If is not the leaves submesh. 
     1059                        if (mSubMeshLeaves != i) 
     1060                        { 
     1061                                indice_acum     =       0; 
     1062 
     1063                                for     (j = 0; j < this->geoMesh->mSubMesh[i].mStripCount; j++) 
     1064                                { 
     1065                                        Index   *aux    =       this->geoMesh->mSubMesh[i].mStrip[j]; 
     1066 
     1067                                        if (j != 0) 
     1068                                        { 
     1069                                                // La primera tira no empieza por índices repetidos. 
     1070                                                aux     =       aux+1; 
     1071 
    10771072                                                indice_acum++; 
    1078                                                  
    1079                                                 aux     =       aux + 1; 
    1080                                         } 
    1081                                          
    1082                                         tira.pop_back(); 
    1083                                         this->cStrips.push_back(tira); 
    1084                                 } 
    1085                                 else 
    1086                                 { 
    1087                                         // Insertar los indices de la última tira en el cStrips 
    1088                                         tira.clear(); 
    1089                                          
    1090                                         for     (       unsigned int k = indice_acum; 
     1073                                        } 
     1074 
     1075                                        if (j+1 < this->geoMesh->mSubMesh[i].mStripCount) 
     1076                                        { 
     1077                                                Index   *siguiente      =       this->geoMesh->mSubMesh[i].mStrip[j+1]; 
     1078 
     1079                                                tira.clear(); 
     1080 
     1081                                                while (aux != siguiente) 
     1082                                                { 
     1083                                                        tira.push_back(*aux); 
     1084                                                        indice_acum++; 
     1085 
     1086                                                        aux     =       aux + 1; 
     1087                                                } 
     1088 
     1089                                                tira.pop_back(); 
     1090                                                this->cStrips.push_back(tira); 
     1091                                        } 
     1092                                        else 
     1093                                        { 
     1094                                                // Insertar los indices de la última tira en el cStrips 
     1095                                                tira.clear(); 
     1096 
     1097                                                for     (       unsigned int k = indice_acum; 
    10911098                                                                k < this->geoMesh->mSubMesh[i].mIndexCount; 
    10921099                                                                k++) 
    1093                                         { 
    1094                                                 tira.push_back(this->geoMesh->mSubMesh[i].mIndex[k]); 
    1095                                         } 
    1096                                          
    1097                                         this->cStrips.push_back(tira); 
    1098                                 } 
    1099                         } 
    1100                          
    1101                         num_vert        +=      this->geoMesh->mSubMesh[i]. 
    1102                                                                                                                                                 mVertexBuffer->mVertexCount; 
     1100                                                { 
     1101                                                        tira.push_back(this->geoMesh->mSubMesh[i].mIndex[k]); 
     1102                                                } 
     1103 
     1104                                                this->cStrips.push_back(tira); 
     1105                                        } 
     1106                                } 
     1107 
     1108                                num_vert        +=      this->geoMesh->mSubMesh[i]. 
     1109                                        mVertexBuffer->mVertexCount; 
     1110                        } 
    11031111                } 
    11041112 
     
    11231131} 
    11241132 
     1133// Sets what is the submesh that stores the leaves. 
     1134void LodStripsConstructor::SetSubMeshLeaves(size_t      submesh) 
     1135{ 
     1136        mSubMeshLeaves  =       submesh; 
     1137} 
     1138 
Note: See TracChangeset for help on using the changeset viewer.