Added tri:UpdatePosition::Scale(mesh)

This commit is contained in:
Paolo Cignoni 2012-01-18 11:22:40 +00:00
parent 880fca974f
commit 048b884a3e
1 changed files with 15 additions and 0 deletions

View File

@ -80,6 +80,21 @@ static void Translate(ComputeMeshType &m, const Point3<ScalarType> &t)
if(!(*vi).IsD()) (*vi).P()+=t;
}
static void Scale(ComputeMeshType &m, const ScalarType s)
{
Scale(m,Point3<ScalarType>(s,s,s));
}
static void Scale(ComputeMeshType &m, const Point3<ScalarType> &s)
{
VertexIterator vi;
for(vi=m.vert.begin();vi!=m.vert.end();++vi)
if(!(*vi).IsD()) {
(*vi).P()[0]*=s[0];
(*vi).P()[1]*=s[1];
(*vi).P()[2]*=s[2];
}
}
}; // end class