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 "objects.hpp"
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
#include <OgreSceneNode.h>
|
#include <OgreSceneNode.h>
|
||||||
#include <OgreSceneManager.h>
|
#include <OgreSceneManager.h>
|
||||||
#include <OgreEntity.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.time = Ogre::Math::RangeRandom(-500, +500);
|
||||||
info.phase = Ogre::Math::RangeRandom(-500, +500);
|
info.phase = Ogre::Math::RangeRandom(-500, +500);
|
||||||
|
|
||||||
bool quadratic;
|
bool quadratic = lightOutQuadInLin() ? !info.interior : lightQuadratic();
|
||||||
if (!lightOutQuadInLin())
|
|
||||||
quadratic = lightQuadratic();
|
|
||||||
else
|
|
||||||
quadratic = !info.interior;
|
|
||||||
|
|
||||||
if (!quadratic)
|
if (!quadratic)
|
||||||
{
|
{
|
||||||
|
@ -286,7 +284,7 @@ void Objects::insertLight (const MWWorld::Ptr& ptr, Ogre::Entity* skelBase, Ogre
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
float r = radius * lightQuadraticRadiusMult();
|
float r = radius * lightQuadraticRadiusMult();
|
||||||
float attenuation = lightQuadraticValue() / pow(r, 2);
|
float attenuation = lightQuadraticValue() / std::pow(r, 2);
|
||||||
light->setAttenuation(r*10, 0, 0, attenuation);
|
light->setAttenuation(r*10, 0, 0, attenuation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue