Changeset 1888 for trunk/src/easymesh
 Timestamp:
 Sep 7, 2012, 5:00:31 PM (7 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/easymesh/easymesh.cpp
r1879 r1888 241 241 { 242 242 Array<int> Welded; 243 243 Welded.Push(1); 244 244 for (int i = m_cursors.Last().m1 + 1; i < m_vert.Count(); i++) 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 245 { 246 int j, k; 247 for (j = m_cursors.Last().m1, k = 0; j < i; j++, k++) 248 { 249 if(Welded[k] < 0) 250 { 251 vec3 diff = m_vert[i].m1  m_vert[j].m1; 252 253 if(diff.x > 0.1f  diff.x < 0.1f) 254 continue; 255 256 if(diff.y > 0.1f  diff.y < 0.1f) 257 continue; 258 259 if(diff.z > 0.1f  diff.z < 0.1f) 260 continue; 261 262 break; 263 } 264 } 265 266 if(j == i) 267 Welded.Push(1); 268 else 269 Welded.Push(j); 270 } 271 272 int i, j; 273 273 for (i = m_cursors.Last().m1, j = 0; i < m_vert.Count(); i++, j++) 274 275 276 277 278 279 280 281 274 { 275 if(Welded[j] == 1) 276 m_vert[i].m1 *= 1.0f + RandF(r); 277 else 278 m_vert[i].m1 = m_vert[Welded[j]].m1; 279 } 280 281 ComputeNormals(m_cursors.Last().m2, m_indices.Count()  m_cursors.Last().m2); 282 282 } 283 283 … … 362 362 363 363 /* Construct normal */ 364 365 366 367 364 if (r2 != .0f) 365 n = vec3(r2, h * .5f, 0.f); 366 else 367 n = vec3(r1, h * .5f, 0.f); 368 368 n.y = r1 * (r1  r2) / h; 369 369 if (!smooth) … … 851 851 for (int i = 0; i < ilen / 3; i++) 852 852 { 853 853 854 854 } 855 855
Note: See TracChangeset
for help on using the changeset viewer.