Changeset 841 for GTP/trunk/Lib/Geom/shared/GTGeometry
- Timestamp:
- 04/27/06 12:01:26 (19 years ago)
- Location:
- GTP/trunk/Lib/Geom/shared/GTGeometry
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoLodStripsConstructor.h
r774 r841 76 76 uint32 TOTALINDICES; 77 77 78 // Index of the submesh leaves. 79 size_t mSubMeshLeaves; 80 78 81 Mesh *geoMesh; 79 82 const Geometry::Mesh *meshoriginal; … … 121 124 LodStripsConstructor( const Mesh *, 122 125 const MeshSimplificationSequence *, 123 Geometry::TIPOFUNC upb); 126 size_t submesh=-1, 127 Geometry::TIPOFUNC upb=NULL); 124 128 125 129 // Destructor … … 141 145 /// GetMesh: Return de current Mesh. 142 146 Mesh * GetMesh(); 147 148 // Sets what is the submesh that stores the leaves 149 void SetSubMeshLeaves(size_t submesh); 150 143 151 }; 144 152 -
GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoMeshStripifier.h
r826 r841 54 54 55 55 // Sets what is the mesh that stores the leaves 56 void setSubMeshLeaves( Geometry::Index);56 void setSubMeshLeaves(size_t); 57 57 58 58 protected: … … 65 65 66 66 // Index of the submesh leaves. 67 Geometry::IndexmSubMeshLeaves;67 size_t mSubMeshLeaves; 68 68 69 69 }; -
GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodStripsConstructor.cpp
r774 r841 484 484 LodStripsConstructor::LodStripsConstructor(const Mesh *m, 485 485 const MeshSimplificationSequence *ms, 486 size_t submesh, 486 487 TIPOFUNC upb) 487 488 { … … 493 494 this->geoMeshSQ = ms; 494 495 496 // Set the leaves submesh. 497 mSubMeshLeaves = submesh; 498 499 495 500 this->GenerarModeloCompleto(upb); 496 501 } … … 784 789 } 785 790 } 786 787 791 } 788 792 … … 1012 1016 { 1013 1017 for ( j = 0; 1014 1015 1018 j < this->geoMesh->mSubMesh[i].mVertexBuffer->mVertexCount; 1019 j++) 1016 1020 { 1017 1021 // Si hay mas de un submesh ListaIndices 1018 1022 // no se rellena correctamente. 1019 1023 vAux.Vertex[0] = this->geoMesh->mSubMesh[i]. 1020 1024 mVertexBuffer->mPosition[j].x; 1021 1025 vAux.Vertex[1] = this->geoMesh->mSubMesh[i]. 1022 1026 mVertexBuffer->mPosition[j].y; 1023 1027 vAux.Vertex[2] = this->geoMesh->mSubMesh[i]. 1024 1028 mVertexBuffer->mPosition[j].z; 1025 1029 // Añadimos las normales en cVerts. 1026 1030 vAux.Normal[0] = this->geoMesh->mSubMesh[i]. 1027 1031 mVertexBuffer->mNormal[j].x; 1028 1032 vAux.Normal[1] = this->geoMesh->mSubMesh[i]. 1029 1033 mVertexBuffer->mNormal[j].y; 1030 1034 vAux.Normal[2] = this->geoMesh->mSubMesh[i]. 1031 1035 mVertexBuffer->mNormal[j].z; 1032 1036 1033 1037 // Añadimos las coordenadas de textura a cVerts. 1034 1038 vAux.TexCoords[0] = this->geoMesh->mSubMesh[i]. 1035 1039 mVertexBuffer->mTexCoords[j].x; 1036 1040 vAux.TexCoords[1] = this->geoMesh->mSubMesh[i]. 1037 1041 mVertexBuffer->mTexCoords[j].y; 1038 1042 1039 1043 vAux.Next = -10; 1040 1044 vAux.numMesh = i; 1041 1045 1042 1046 this->cVerts.push_back(vAux); 1043 1047 } … … 1052 1056 for (i = 0; i < this->geoMesh->mSubMeshCount; i++) 1053 1057 { 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 1077 1072 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; 1091 1098 k < this->geoMesh->mSubMesh[i].mIndexCount; 1092 1099 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 } 1103 1111 } 1104 1112 … … 1123 1131 } 1124 1132 1133 // Sets what is the submesh that stores the leaves. 1134 void LodStripsConstructor::SetSubMeshLeaves(size_t submesh) 1135 { 1136 mSubMeshLeaves = submesh; 1137 } 1138
Note: See TracChangeset
for help on using the changeset viewer.