Small changes in the long long way to making meshlab and the vcglib really float/double independent

This commit is contained in:
Paolo Cignoni 2014-06-18 17:29:34 +00:00
parent c5efcad9a2
commit e768943f3e
1 changed files with 489 additions and 488 deletions

View File

@ -244,6 +244,7 @@ public:
template <class FaceType> template <class FaceType>
void byFace(FaceType &f, math::Quadric<double> &q1, math::Quadric<double> &q2, math::Quadric<double> &q3, bool QualityQuadric, ScalarType BorderWeight) void byFace(FaceType &f, math::Quadric<double> &q1, math::Quadric<double> &q2, math::Quadric<double> &q3, bool QualityQuadric, ScalarType BorderWeight)
{ {
typedef typename FaceType::VertexType::CoordType CoordType;
double q = QualityFace(f); double q = QualityFace(f);
// if quality==0 then the geometrical quadric has just zeroes // if quality==0 then the geometrical quadric has just zeroes
@ -260,10 +261,10 @@ public:
{ {
Quadric5<double> temp; Quadric5<double> temp;
TexCoord2f newtex; TexCoord2f newtex;
Point3f newpoint = (f.P0(j)+f.P1(j))/2.0 + (f.N()/f.N().Norm())*Distance(f.P0(j),f.P1(j)); CoordType newpoint = (f.P0(j)+f.P1(j))/2.0 + (f.N()/f.N().Norm())*Distance(f.P0(j),f.P1(j));
newtex.u() = (f.WT( (j+0)%3 ).u()+f.WT( (j+1)%3 ).u())/2.0; newtex.u() = (f.WT( (j+0)%3 ).u()+f.WT( (j+1)%3 ).u())/2.0;
newtex.v() = (f.WT( (j+0)%3 ).v()+f.WT( (j+1)%3 ).v())/2.0; newtex.v() = (f.WT( (j+0)%3 ).v()+f.WT( (j+1)%3 ).v())/2.0;
Point3f oldpoint = f.P2(j); CoordType oldpoint = f.P2(j);
TexCoord2f oldtex = f.WT((j+2)%3); TexCoord2f oldtex = f.WT((j+2)%3);
f.P2(j)=newpoint; f.P2(j)=newpoint;