Make projectiles receive lighting

openmw-38
scrawl 9 years ago
parent 258f7a2b42
commit 67a6a8f5d4

@ -227,6 +227,11 @@ namespace MWRender
return mResourceSystem;
}
osg::Group* RenderingManager::getLightRoot()
{
return mLightRoot.get();
}
void RenderingManager::setNightEyeFactor(float factor)
{
if (factor != mNightEyeFactor)

@ -65,6 +65,8 @@ namespace MWRender
Resource::ResourceSystem* getResourceSystem();
osg::Group* getLightRoot();
void setNightEyeFactor(float factor);
void setAmbientColour(const osg::Vec4f& colour);

@ -8,6 +8,7 @@
#include <components/resource/scenemanager.hpp>
#include <components/sceneutil/controller.hpp>
#include <components/sceneutil/visitor.hpp>
#include <components/sceneutil/lightmanager.hpp>
#include "../mwworld/manualref.hpp"
#include "../mwworld/class.hpp"
@ -96,6 +97,8 @@ namespace MWWorld
SceneUtil::DisableFreezeOnCullVisitor disableFreezeOnCullVisitor;
state.mNode->accept(disableFreezeOnCullVisitor);
state.mNode->addCullCallback(new SceneUtil::LightListCallback);
mParent->addChild(state.mNode);
state.mEffectAnimationTime.reset(new MWRender::EffectAnimationTime);

@ -164,7 +164,7 @@ namespace MWWorld
{
mPhysics = new MWPhysics::PhysicsSystem(resourceSystem, rootNode);
mRendering = new MWRender::RenderingManager(viewer, rootNode, resourceSystem, &mFallback, resourcePath);
mProjectileManager.reset(new ProjectileManager(rootNode, resourceSystem, mRendering, mPhysics));
mProjectileManager.reset(new ProjectileManager(mRendering->getLightRoot(), resourceSystem, mRendering, mPhysics));
mEsm.resize(contentFiles.size());
Loading::Listener* listener = MWBase::Environment::get().getWindowManager()->getLoadingScreen();

Loading…
Cancel
Save