Changeset 2086 for GTP/trunk/Lib
- Timestamp:
- 02/05/07 13:27:05 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoMeshSimplifier.cpp
r2081 r2086 71 71 void MeshSimplifier::sortBones() 72 72 { 73 <<<<<<< .mine74 73 VertexBuffer *simplified_vb; 75 74 VertexBuffer *initial_vb; 76 ======= 77 VertexBuffer *mesh_vb; 78 VertexBuffer *copy_vb; 79 >>>>>>> .r2080 80 81 <<<<<<< .mine 75 82 76 std::vector<VertexBoneAssignment> *simplified_bones; 83 77 std::vector<VertexBoneAssignment> *initial_bones; 84 ======= 85 std::vector<VertexBoneAssignment> *mesh_bones; 86 std::vector<VertexBoneAssignment> *copy_bones; 87 >>>>>>> .r2080 88 89 <<<<<<< .mine 78 90 79 // After simplifying, the object always is shared vertex 91 80 // so, the bones must be placed in the GeoMesh 92 81 simplified_bones = &mGeoMesh->mBones; 93 82 simplified_vb = mGeoMesh->mVertexBuffer; 94 ======= 95 // After simplifying, the object always is shared vertex 96 // so, the bones must be placed in the GeoMesh 97 mesh_bones = &mGeoMesh->mBones; 98 mesh_vb = mGeoMesh->mVertexBuffer; 99 >>>>>>> .r2080 100 101 <<<<<<< .mine 83 102 84 // we assume the original mesh is shared vertex 103 85 // because before the simplification process … … 105 87 // so, the original bones must be searched in the 106 88 // Mesh, not in every submesh 107 ======= 108 // we assume the original mesh is shared vertex 109 // because before the simplification process 110 // the mesh becomes converted to shared vertex 111 // so, the original bones must be searched in the 112 // Mesh, not in every submesh 113 >>>>>>> .r2080 114 115 <<<<<<< .mine 89 116 90 simplified_bones->clear(); 117 ======= 118 mesh_bones->clear(); 119 >>>>>>> .r2080 120 121 <<<<<<< .mine 91 122 92 // Vertex buffers. 123 93 initial_vb = mInitialMesh->mVertexBuffer; 124 ======= 125 // Vertex buffers. 126 copy_vb = mInitialMesh->mVertexBuffer; 127 >>>>>>> .r2080 128 129 <<<<<<< .mine 94 130 95 // Bones. 131 96 initial_bones = &mInitialMesh->mBones; 132 ======= 133 // Bones. 134 copy_bones = &mInitialMesh->mBones; 135 136 // If there are submesh bones. 137 for (int b = 0; b < copy_bones->size(); b++) 138 { 139 VertexBoneAssignment assign; 140 >>>>>>> .r2080 141 142 <<<<<<< .mine 97 143 98 // For each bone assignment. 144 99 for (int b = 0; b < initial_bones->size(); b++) 145 100 { 146 101 VertexBoneAssignment assign; 147 ======= 148 int n = (*copy_bones)[b].vertexIndex; 149 >>>>>>> .r2080 150 151 <<<<<<< .mine 102 152 103 int n = (*initial_bones)[b].vertexIndex; 153 104 … … 165 116 simplified_bones->push_back(assign); 166 117 } 167 =======168 // Initialize o.169 170 int o=0;171 for (o=0; o<mesh_vb->mVertexCount; o++)172 {173 if (mesh_vb->mPosition[o].x == copy_vb->mPosition[n].x &&174 mesh_vb->mPosition[o].y == copy_vb->mPosition[n].y &&175 mesh_vb->mPosition[o].z == copy_vb->mPosition[n].z)176 {177 assign.vertexIndex = o;178 assign.boneIndex = (*copy_bones)[b].boneIndex;179 assign.weight = 1.0f;180 mesh_bones->push_back(assign);181 }182 >>>>>>> .r2080183 118 } 184 119 } … … 234 169 //mGeoMesh = sharedMesh; 235 170 236 // if the initial mesh had shared vertex,237 // convert the mesh to shared vertex238 for (int i=0; i<mInitialMesh->mSubMeshCount; i++)239 {240 if (mInitialMesh->mSubMesh[i].mSharedVertexBuffer)241 {242 Mesh *sharedMesh = mGeoMesh->toSharedVertex();243 delete mGeoMesh;244 mGeoMesh = sharedMesh;245 break;246 }247 }248 249 171 // Sort bones. 250 172 //sortBones(); … … 275 197 //mGeoMesh = sharedMesh; 276 198 277 // if the initial mesh had shared vertex,278 // convert the mesh to shared vertex279 for (int i=0; i<mInitialMesh->mSubMeshCount; i++)280 {281 if (mInitialMesh->mSubMesh[i].mSharedVertexBuffer)282 {283 Mesh *sharedMesh = mGeoMesh->toSharedVertex();284 delete mGeoMesh;285 mGeoMesh = sharedMesh;286 break;287 }288 }289 290 199 // Sort bones. 291 200 //sortBones();
Note: See TracChangeset
for help on using the changeset viewer.