Gui: Use std::numeric_limits and std::numbers instead of defines
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
#include "NavigationAnimation.h"
|
||||
#include <Inventor/nodes/SoCamera.h>
|
||||
|
||||
#include <numbers>
|
||||
|
||||
using namespace Gui;
|
||||
|
||||
NavigationAnimation::NavigationAnimation(NavigationStyle* navigation)
|
||||
@@ -69,8 +71,8 @@ void FixedTimeAnimation::initialize()
|
||||
SbVec3f rotationAxisPost;
|
||||
float angle;
|
||||
SbRotation(navigation->getCamera()->orientation.getValue().inverse() * targetOrientation).getValue(rotationAxisPost, angle);
|
||||
if (angle > M_PI) {
|
||||
angle -= float(2 * M_PI);
|
||||
if (angle > std::numbers::pi) {
|
||||
angle -= float(2 * std::numbers::pi);
|
||||
}
|
||||
|
||||
// Convert post-multiplication axis to a pre-multiplication axis
|
||||
@@ -130,9 +132,9 @@ SpinningAnimation::SpinningAnimation(NavigationStyle* navigation, const SbVec3f&
|
||||
: NavigationAnimation(navigation)
|
||||
, rotationAxis(axis)
|
||||
{
|
||||
setDuration((2 * M_PI / velocity) * 1000.0);
|
||||
setDuration((2 * std::numbers::pi / velocity) * 1000.0);
|
||||
setStartValue(0.0);
|
||||
setEndValue(2 * M_PI);
|
||||
setEndValue(2 * std::numbers::pi);
|
||||
setLoopCount(-1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user