1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

Make projectiles receive lighting

This commit is contained in:
scrawl 2015-12-05 00:44:04 +01:00
parent 258f7a2b42
commit 67a6a8f5d4
4 changed files with 11 additions and 1 deletions

View File

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

View File

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

View File

@ -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);

View File

@ -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();