Browse Source

optim radialJitter

legacy
Cédric Lecacheur elliotek 12 years ago
parent
commit
4e7af3279c
1 changed files with 16 additions and 3 deletions
  1. +16
    -3
      src/easymesh/easymesh.cpp

+ 16
- 3
src/easymesh/easymesh.cpp View File

@@ -243,11 +243,24 @@ void EasyMesh::RadialJitter(float r)
Welded.Push(-1); Welded.Push(-1);
for (int i = m_cursors.Last().m1 + 1; i < m_vert.Count(); i++) for (int i = m_cursors.Last().m1 + 1; i < m_vert.Count(); i++)
{ {
int j;
for (j = m_cursors.Last().m1; j < i; j++)
int j, k;
for (j = m_cursors.Last().m1, k = 0; j < i; j++, k++)
{ {
if(sqlength(m_vert[i].m1 - m_vert[j].m1) < 0.1f)
if(Welded[k] < 0)
{
vec3 diff = m_vert[i].m1 - m_vert[j].m1;
if(diff.x > 0.1f || diff.x < -0.1f)
continue;

if(diff.y > 0.1f || diff.y < -0.1f)
continue;

if(diff.z > 0.1f || diff.z < -0.1f)
continue;

break; break;
}
} }


if(j == i) if(j == i)


Loading…
Cancel
Save