Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scale light intensity by PI for Ogre2 #284

Merged
merged 1 commit into from
Mar 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ogre2/src/Ogre2Light.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ void Ogre2Light::SetAttenuationRange(double _range)
//////////////////////////////////////////////////
double Ogre2Light::Intensity() const
{
return this->ogreLight->getPowerScale();
return this->ogreLight->getPowerScale() / IGN_PI;
}

//////////////////////////////////////////////////
void Ogre2Light::SetIntensity(double _intensity)
{
this->ogreLight->setPowerScale(_intensity);
this->ogreLight->setPowerScale(_intensity * IGN_PI);
}

//////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src/Light_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void LightTest::Light(const std::string &_renderEngine)

// intensity
light->SetIntensity(1.25);
EXPECT_DOUBLE_EQ(1.25, light->Intensity());
EXPECT_NEAR(1.25, light->Intensity(), 1e-6);

// attenuation
// Checking near because Ogre stores it as float
Expand Down