mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 22:15:32 +00:00
Forgot to add
This commit is contained in:
parent
987e923790
commit
246b06ca27
1 changed files with 6 additions and 5 deletions
|
@ -139,8 +139,6 @@ void Objects::insertModel(const MWWorld::Ptr &ptr, const std::string &mesh, bool
|
||||||
SceneUtil::FindByNameVisitor visitor("AttachLight");
|
SceneUtil::FindByNameVisitor visitor("AttachLight");
|
||||||
ptr.getRefData().getBaseNode()->accept(visitor);
|
ptr.getRefData().getBaseNode()->accept(visitor);
|
||||||
|
|
||||||
osg::Vec3f lightOffset (0.f, 0.f, 0.f);
|
|
||||||
|
|
||||||
osg::Group* attachTo = NULL;
|
osg::Group* attachTo = NULL;
|
||||||
if (visitor.mFoundNode)
|
if (visitor.mFoundNode)
|
||||||
{
|
{
|
||||||
|
@ -152,9 +150,13 @@ void Objects::insertModel(const MWWorld::Ptr &ptr, const std::string &mesh, bool
|
||||||
osg::Group* objectRoot = anim->getOrCreateObjectRoot();
|
osg::Group* objectRoot = anim->getOrCreateObjectRoot();
|
||||||
objectRoot->accept(computeBound);
|
objectRoot->accept(computeBound);
|
||||||
|
|
||||||
lightOffset = computeBound.getBoundingBox().center();
|
// PositionAttitudeTransform seems to be slightly faster than MatrixTransform
|
||||||
|
osg::ref_ptr<osg::PositionAttitudeTransform> trans(new osg::PositionAttitudeTransform);
|
||||||
|
trans->setPosition(computeBound.getBoundingBox().center());
|
||||||
|
|
||||||
attachTo = objectRoot;
|
objectRoot->addChild(trans);
|
||||||
|
|
||||||
|
attachTo = trans;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ESM::Light* esmLight = ptr.get<ESM::Light>()->mBase;
|
const ESM::Light* esmLight = ptr.get<ESM::Light>()->mBase;
|
||||||
|
@ -162,7 +164,6 @@ void Objects::insertModel(const MWWorld::Ptr &ptr, const std::string &mesh, bool
|
||||||
osg::ref_ptr<SceneUtil::LightSource> lightSource = new SceneUtil::LightSource;
|
osg::ref_ptr<SceneUtil::LightSource> lightSource = new SceneUtil::LightSource;
|
||||||
osg::Light* light = new osg::Light;
|
osg::Light* light = new osg::Light;
|
||||||
lightSource->setLight(light);
|
lightSource->setLight(light);
|
||||||
light->setPosition(osg::Vec4f(lightOffset.x(), lightOffset.y(), lightOffset.z(), 1.f));
|
|
||||||
|
|
||||||
float realRadius = esmLight->mData.mRadius * 2;
|
float realRadius = esmLight->mData.mRadius * 2;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue