From 225af65457c4572bb9cf9aa38243239028c2b196 Mon Sep 17 00:00:00 2001 From: cignoni Date: Wed, 18 Jun 2014 10:38:52 +0000 Subject: [PATCH] Small changes in the long long way to making meshlab and the vcglib really float/double independent --- vcg/complex/algorithms/create/platonic.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/vcg/complex/algorithms/create/platonic.h b/vcg/complex/algorithms/create/platonic.h index a7e09a89..a355d450 100644 --- a/vcg/complex/algorithms/create/platonic.h +++ b/vcg/complex/algorithms/create/platonic.h @@ -360,10 +360,11 @@ void Square(MeshType &in) template void SphericalCap(MeshType &in, float angleRad, const int subdiv = 3 ) { + typedef typename MeshType::CoordType CoordType; in.Clear(); - tri::Allocator::AddVertex(in,Point3f(0,0,0)); + tri::Allocator::AddVertex(in,CoordType(0,0,0)); for(int i=0;i<6;++i) - tri::Allocator::AddVertex(in,Point3f(cos(math::ToRad(i*60.0)),sin(math::ToRad(i*60.0)),0)); + tri::Allocator::AddVertex(in,CoordType(cos(math::ToRad(i*60.0)),sin(math::ToRad(i*60.0)),0)); for(int i=0;i<6;++i) tri::Allocator::AddFace(in,&(in.vert[0]),&(in.vert[1+i]),&(in.vert[1+(i+1)%6])); @@ -573,17 +574,20 @@ void Box(MeshType &in, const typename MeshType::BoxType & bb ) template void Torus(MeshType &m, float hRingRadius, float vRingRadius, int hRingDiv=24, int vRingDiv=12 ) { + typedef typename MeshType::CoordType CoordType; + typedef typename MeshType::ScalarType ScalarType; + typedef Matrix44 Matrix44x; m.Clear(); - float angleStepV = (2.0f*M_PI)/vRingDiv; - float angleStepH = (2.0f*M_PI)/hRingDiv; + ScalarType angleStepV = (2.0f*M_PI)/vRingDiv; + ScalarType angleStepH = (2.0f*M_PI)/hRingDiv; Allocator::AddVertices(m,(vRingDiv+1)*(hRingDiv+1)); for(int i=0;i