mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 20:53:50 +00:00
Use osg::PI over M_PI
This commit is contained in:
parent
44ca881614
commit
dc1f788cff
3 changed files with 5 additions and 6 deletions
|
@ -215,7 +215,6 @@ if (MSVC)
|
||||||
if (CMAKE_CL_64)
|
if (CMAKE_CL_64)
|
||||||
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj")
|
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj")
|
||||||
endif (CMAKE_CL_64)
|
endif (CMAKE_CL_64)
|
||||||
add_definitions("-D_USE_MATH_DEFINES")
|
|
||||||
endif (MSVC)
|
endif (MSVC)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
|
|
@ -943,8 +943,8 @@ public:
|
||||||
|
|
||||||
void setState(const MoonState& state)
|
void setState(const MoonState& state)
|
||||||
{
|
{
|
||||||
float radsX = ((state.mRotationFromHorizon) * M_PI) / 180.0f;
|
float radsX = ((state.mRotationFromHorizon) * static_cast<float>(osg::PI)) / 180.0f;
|
||||||
float radsZ = ((state.mRotationFromNorth) * M_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 rotX(radsX, osg::Vec3f(1.0f, 0.0f, 0.0f));
|
||||||
osg::Quat rotZ(radsZ, osg::Vec3f(0.0f, 0.0f, 1.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
|
// 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.
|
// 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);
|
mTransform->setAttitude(attX * rotZ);
|
||||||
|
|
||||||
setPhase(state.mPhase);
|
setPhase(state.mPhase);
|
||||||
|
|
|
@ -695,9 +695,9 @@ void WeatherManager::update(float duration, bool paused)
|
||||||
|
|
||||||
double theta;
|
double theta;
|
||||||
if ( !is_night ) {
|
if ( !is_night ) {
|
||||||
theta = M_PI * (adjustedHour - mSunriseTime) / dayDuration;
|
theta = static_cast<float>(osg::PI) * (adjustedHour - mSunriseTime) / dayDuration;
|
||||||
} else {
|
} else {
|
||||||
theta = M_PI * (1.f - (adjustedHour - adjustedNightStart) / nightDuration);
|
theta = static_cast<float>(osg::PI) * (1.f - (adjustedHour - adjustedNightStart) / nightDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
osg::Vec3f final(
|
osg::Vec3f final(
|
||||||
|
|
Loading…
Reference in a new issue