forked from mirror/openmw-tes3mp
some random cleanup
This commit is contained in:
parent
c5f0556451
commit
e7684c4677
1 changed files with 4 additions and 6 deletions
|
@ -1,5 +1,7 @@
|
|||
#include "objects.hpp"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include <OgreSceneNode.h>
|
||||
#include <OgreSceneManager.h>
|
||||
#include <OgreEntity.h>
|
||||
|
@ -271,11 +273,7 @@ void Objects::insertLight (const MWWorld::Ptr& ptr, Ogre::Entity* skelBase, Ogre
|
|||
info.time = Ogre::Math::RangeRandom(-500, +500);
|
||||
info.phase = Ogre::Math::RangeRandom(-500, +500);
|
||||
|
||||
bool quadratic;
|
||||
if (!lightOutQuadInLin())
|
||||
quadratic = lightQuadratic();
|
||||
else
|
||||
quadratic = !info.interior;
|
||||
bool quadratic = lightOutQuadInLin() ? !info.interior : lightQuadratic();
|
||||
|
||||
if (!quadratic)
|
||||
{
|
||||
|
@ -286,7 +284,7 @@ void Objects::insertLight (const MWWorld::Ptr& ptr, Ogre::Entity* skelBase, Ogre
|
|||
else
|
||||
{
|
||||
float r = radius * lightQuadraticRadiusMult();
|
||||
float attenuation = lightQuadraticValue() / pow(r, 2);
|
||||
float attenuation = lightQuadraticValue() / std::pow(r, 2);
|
||||
light->setAttenuation(r*10, 0, 0, attenuation);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue