MSVC: fix warnings and build failure

This commit is contained in:
wmayer
2023-09-23 19:03:53 +02:00
committed by wwmayer
parent 28ae0831cb
commit 1cdff85086
6 changed files with 30 additions and 13 deletions

View File

@@ -969,16 +969,22 @@ SbRotation NaviCubeImplementation::getNearestOrientation(PickId pickId) {
angle *= -1;
}
static const float pi = boost::math::constants::pi<float>();
static const float pi2 = boost::math::constants::two_pi<float>();
static const float pi1_2 = boost::math::constants::half_pi<float>();
static const float pi1_3 = boost::math::constants::third_pi<float>();
static const float pi2_3 = boost::math::constants::two_thirds_pi<float>();
// Make angle positive
if (angle < 0) {
angle += 2 * M_PI;
angle += pi2;
}
// f is a small value used to control orientation priority when the camera is almost exactly between two
// orientations (e.g. +45 and -45 degrees). The standard orientation is preferred compared to
// +90 and -90 degree orientations and the +90 and -90 degree orientations are preferred compared to an
// upside down standard orientation
float f = 0.00001;
float f = 0.00001F;
// Find the angle to rotate to the nearest orientation
if (m_Faces[pickId].type == ShapeId::Corner) {
@@ -987,19 +993,19 @@ SbRotation NaviCubeImplementation::getNearestOrientation(PickId pickId) {
angle = 0;
}
else if (angle <= (M_PI_2 + f)) {
angle = M_PI / 3;
angle = pi1_3;
}
else if (angle < (5 * M_PI / 6 - f)) {
angle = 2 * M_PI / 3;
angle = pi2_3;
}
else if (angle <= (M_PI + M_PI / 6 + f)) {
angle = M_PI;
angle = pi;
}
else if (angle < (M_PI + M_PI_2 - f)) {
angle = M_PI + M_PI / 3;
angle = pi + pi1_3;
}
else if (angle < (M_PI + 5 * M_PI / 6 - f)) {
angle = M_PI + 2 * M_PI / 3;
angle = pi + pi2_3;
}
else {
angle = 0;
@@ -1011,13 +1017,13 @@ SbRotation NaviCubeImplementation::getNearestOrientation(PickId pickId) {
angle = 0;
}
else if (angle <= (3 * M_PI_4 + f)) {
angle = M_PI_2;
angle = pi1_2;
}
else if (angle < (M_PI + M_PI_4 - f)) {
angle = M_PI;
angle = pi;
}
else if (angle < (M_PI + 3 * M_PI_4 - f)) {
angle = M_PI + M_PI_2;
angle = pi + pi1_2;
}
else {
angle = 0;