diff --git a/apps/sample/space_packer/space_packer.cpp b/apps/sample/space_packer/space_packer.cpp index 83652b03..876a58c0 100644 --- a/apps/sample/space_packer/space_packer.cpp +++ b/apps/sample/space_packer/space_packer.cpp @@ -27,6 +27,7 @@ #include #include #include +#include using namespace vcg; using namespace std; @@ -44,7 +45,7 @@ void buildRandRectSet(int rectNum, vector &rectVec) { Box2f bb; float ratio=ratioMin+(ratioMax-ratioMin)*rnd.generate01(); - float size= sizeMin+(sizeMax-sizeMin)*pow(rnd.generate01(),exp); + float size= sizeMin+(sizeMax-sizeMin)*pow((float)rnd.generate01(),exp); bb.min=Point2f(-size*ratio,-size); bb.max=Point2f( size*ratio, size); rectVec.push_back(bb); @@ -59,8 +60,8 @@ void buildRandRectSetOld(int rectNum, vector &rectVec) for(int i=0;i