|
|
|
@ -2,8 +2,6 @@
|
|
|
|
|
|
|
|
|
|
#include <osg/UserDataContainer>
|
|
|
|
|
#include <osg/MatrixTransform>
|
|
|
|
|
#include <osg/BlendFunc>
|
|
|
|
|
#include <osg/Material>
|
|
|
|
|
|
|
|
|
|
#include <components/misc/rng.hpp>
|
|
|
|
|
|
|
|
|
@ -278,7 +276,6 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, osg::ref_ptr<osg::Group> par
|
|
|
|
|
mShowWeapons(false),
|
|
|
|
|
mShowCarriedLeft(true),
|
|
|
|
|
mNpcType(Type_Normal),
|
|
|
|
|
mAlpha(1.f),
|
|
|
|
|
mSoundsDisabled(disableSounds)
|
|
|
|
|
{
|
|
|
|
|
mNpc = mPtr.get<ESM::NPC>()->mBase;
|
|
|
|
@ -422,7 +419,6 @@ void NpcAnimation::updateParts()
|
|
|
|
|
if (!mObjectRoot.get())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
mAlpha = 1.f;
|
|
|
|
|
const MWWorld::Class &cls = mPtr.getClass();
|
|
|
|
|
|
|
|
|
|
NpcType curType = Type_Normal;
|
|
|
|
@ -902,7 +898,6 @@ void NpcAnimation::showWeapons(bool showWeapon)
|
|
|
|
|
{
|
|
|
|
|
removeIndividualPart(ESM::PRT_Weapon);
|
|
|
|
|
}
|
|
|
|
|
mAlpha = 1.f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NpcAnimation::showCarriedLeft(bool show)
|
|
|
|
@ -988,37 +983,6 @@ void NpcAnimation::permanentEffectAdded(const ESM::MagicEffect *magicEffect, boo
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NpcAnimation::setAlpha(float alpha)
|
|
|
|
|
{
|
|
|
|
|
if (alpha == mAlpha)
|
|
|
|
|
return;
|
|
|
|
|
mAlpha = alpha;
|
|
|
|
|
|
|
|
|
|
if (alpha != 1.f)
|
|
|
|
|
{
|
|
|
|
|
osg::StateSet* stateset (new osg::StateSet);
|
|
|
|
|
|
|
|
|
|
osg::BlendFunc* blendfunc (new osg::BlendFunc);
|
|
|
|
|
stateset->setAttributeAndModes(blendfunc, osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE);
|
|
|
|
|
|
|
|
|
|
// FIXME: overriding diffuse/ambient/emissive colors
|
|
|
|
|
osg::Material* material (new osg::Material);
|
|
|
|
|
material->setColorMode(osg::Material::OFF);
|
|
|
|
|
material->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4f(1,1,1,alpha));
|
|
|
|
|
material->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4f(1,1,1,1));
|
|
|
|
|
stateset->setAttributeAndModes(material, osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE);
|
|
|
|
|
|
|
|
|
|
stateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
|
|
|
|
|
stateset->setRenderBinMode(osg::StateSet::OVERRIDE_RENDERBIN_DETAILS);
|
|
|
|
|
stateset->setNestRenderBins(false);
|
|
|
|
|
mObjectRoot->setStateSet(stateset);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
mObjectRoot->setStateSet(NULL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NpcAnimation::enableHeadAnimation(bool enable)
|
|
|
|
|
{
|
|
|
|
|
mHeadAnimationTime->setEnabled(enable);
|
|
|
|
|