mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-29 09:32:45 +00:00
Use osg::PI over M_PI
This commit is contained in:
parent
44ca881614
commit
dc1f788cff
@ -215,7 +215,6 @@ if (MSVC)
|
||||
if (CMAKE_CL_64)
|
||||
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj")
|
||||
endif (CMAKE_CL_64)
|
||||
add_definitions("-D_USE_MATH_DEFINES")
|
||||
endif (MSVC)
|
||||
|
||||
if (WIN32)
|
||||
|
@ -943,8 +943,8 @@ public:
|
||||
|
||||
void setState(const MoonState& state)
|
||||
{
|
||||
float radsX = ((state.mRotationFromHorizon) * M_PI) / 180.0f;
|
||||
float radsZ = ((state.mRotationFromNorth) * M_PI) / 180.0f;
|
||||
float radsX = ((state.mRotationFromHorizon) * static_cast<float>(osg::PI)) / 180.0f;
|
||||
float radsZ = ((state.mRotationFromNorth) * static_cast<float>(osg::PI)) / 180.0f;
|
||||
|
||||
osg::Quat rotX(radsX, osg::Vec3f(1.0f, 0.0f, 0.0f));
|
||||
osg::Quat rotZ(radsZ, osg::Vec3f(0.0f, 0.0f, 1.0f));
|
||||
@ -954,7 +954,7 @@ public:
|
||||
|
||||
// The moon quad is initially oriented facing down, so we need to offset its X-axis
|
||||
// rotation to rotate it to face the camera when sitting at the horizon.
|
||||
osg::Quat attX((-M_PI / 2.0f) + radsX, osg::Vec3f(1.0f, 0.0f, 0.0f));
|
||||
osg::Quat attX((-static_cast<float>(osg::PI) / 2.0f) + radsX, osg::Vec3f(1.0f, 0.0f, 0.0f));
|
||||
mTransform->setAttitude(attX * rotZ);
|
||||
|
||||
setPhase(state.mPhase);
|
||||
|
@ -695,9 +695,9 @@ void WeatherManager::update(float duration, bool paused)
|
||||
|
||||
double theta;
|
||||
if ( !is_night ) {
|
||||
theta = M_PI * (adjustedHour - mSunriseTime) / dayDuration;
|
||||
theta = static_cast<float>(osg::PI) * (adjustedHour - mSunriseTime) / dayDuration;
|
||||
} else {
|
||||
theta = M_PI * (1.f - (adjustedHour - adjustedNightStart) / nightDuration);
|
||||
theta = static_cast<float>(osg::PI) * (1.f - (adjustedHour - adjustedNightStart) / nightDuration);
|
||||
}
|
||||
|
||||
osg::Vec3f final(
|
||||
|
Loading…
x
Reference in New Issue
Block a user