Skip to content

Commit

Permalink
Scale intensity by PI for Ogre2 (#284)
Browse files Browse the repository at this point in the history
Signed-off-by: Addisu Z. Taddese <[email protected]>
  • Loading branch information
azeey authored Mar 26, 2021
1 parent e0bf818 commit 3f9cc5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit 3f9cc5a

Please sign in to comment.