fixed cross-platform math usage
This commit is contained in:
parent
7bb11892bb
commit
c17b10bf63
|
@ -173,7 +173,7 @@ bool test5(vcg::Shotd shot, vcg::Point3d p1, vcg::Point3d p2)
|
|||
diff = (p2proj - p1proj);
|
||||
distance_after_world_scaling = diff.Norm();
|
||||
|
||||
if (std::fabs(distance_before_world_scaling - (distance_after_world_scaling / scalefactor)) > precision)
|
||||
if (vcg::math::Abs(distance_before_world_scaling - (distance_after_world_scaling / scalefactor)) > precision)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
@ -438,17 +438,17 @@ int main()
|
|||
|
||||
vcg::Matrix44d R1; // -10 degree around Y axis
|
||||
double deg2rad = 0.01745329251994329576923690768489;
|
||||
R1.ElementAt(0,0) = std::cos(-10.0*deg2rad);
|
||||
R1.ElementAt(0,0) = vcg::math::Cos(-10.0*deg2rad);
|
||||
R1.ElementAt(0,1) = 0.0;
|
||||
R1.ElementAt(0,2) = std::sin(-10.0*deg2rad);
|
||||
R1.ElementAt(0,2) = vcg::math::Sin(-10.0*deg2rad);
|
||||
R1.ElementAt(0,3) = 0.0;
|
||||
R1.ElementAt(1,0) = 0.0;
|
||||
R1.ElementAt(1,1) = 1.0;
|
||||
R1.ElementAt(1,2) = 0.0;
|
||||
R1.ElementAt(1,3) = 0.0;
|
||||
R1.ElementAt(2,0) = -std::sin(-10.0*deg2rad);
|
||||
R1.ElementAt(2,0) = -vcg::math::Sin(-10.0*deg2rad);
|
||||
R1.ElementAt(2,1) = 0.0;
|
||||
R1.ElementAt(2,2) = std::cos(-10.0*deg2rad);
|
||||
R1.ElementAt(2,2) = vcg::math::Cos(-10.0*deg2rad);
|
||||
R1.ElementAt(2,3) = 0.0;
|
||||
R1.ElementAt(3,0) = 0.0;
|
||||
R1.ElementAt(3,1) = 0.0;
|
||||
|
@ -472,17 +472,17 @@ int main()
|
|||
|
||||
|
||||
vcg::Matrix44d R2; // 18 degree around Y axis (+ 180 degree for the correct orientation of the camera)
|
||||
R2.ElementAt(0,0) = std::cos(-45.0*deg2rad);
|
||||
R2.ElementAt(0,0) = vcg::math::Cos(-45.0*deg2rad);
|
||||
R2.ElementAt(0,1) = 0.0;
|
||||
R2.ElementAt(0,2) = std::sin(-45.0*deg2rad);
|
||||
R2.ElementAt(0,2) = vcg::math::Sin(-45.0*deg2rad);
|
||||
R2.ElementAt(0,3) = 0.0;
|
||||
R2.ElementAt(1,0) = 0.0;
|
||||
R2.ElementAt(1,1) = 1.0;
|
||||
R2.ElementAt(1,2) = 0.0;
|
||||
R2.ElementAt(1,3) = 0.0;
|
||||
R2.ElementAt(2,0) = -std::sin(-45.0*deg2rad);
|
||||
R2.ElementAt(2,0) = -vcg::math::Sin(-45.0*deg2rad);
|
||||
R2.ElementAt(2,1) = 0.0;
|
||||
R2.ElementAt(2,2) = std::cos(-45.0*deg2rad);
|
||||
R2.ElementAt(2,2) = vcg::math::Cos(-45.0*deg2rad);
|
||||
R2.ElementAt(2,3) = 0.0;
|
||||
R2.ElementAt(3,0) = 0.0;
|
||||
R2.ElementAt(3,1) = 0.0;
|
||||
|
|
Loading…
Reference in New Issue