mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-19 13:11:32 +00:00
Merge branch 'headsup' into 'master'
Force assign head animation timer (bug #4389) Closes #4389 See merge request OpenMW/openmw!1361
This commit is contained in:
commit
d4e8a58351
5 changed files with 38 additions and 8 deletions
|
@ -11,6 +11,7 @@
|
||||||
Bug #3855: AI sometimes spams defensive spells
|
Bug #3855: AI sometimes spams defensive spells
|
||||||
Bug #3905: Great House Dagoth issues
|
Bug #3905: Great House Dagoth issues
|
||||||
Bug #4203: Resurrecting an actor should close the loot GUI
|
Bug #4203: Resurrecting an actor should close the loot GUI
|
||||||
|
Bug #4389: NPC's lips do not move if his head model has the NiBSAnimationNode root node
|
||||||
Bug #4602: Robert's Bodies: crash inside createInstance()
|
Bug #4602: Robert's Bodies: crash inside createInstance()
|
||||||
Bug #4700: Editor: Incorrect command implementation
|
Bug #4700: Editor: Incorrect command implementation
|
||||||
Bug #4744: Invisible particles must still be processed
|
Bug #4744: Invisible particles must still be processed
|
||||||
|
|
|
@ -332,7 +332,7 @@ void ActorAnimation::resetControllers(osg::Node* node)
|
||||||
|
|
||||||
std::shared_ptr<SceneUtil::ControllerSource> src;
|
std::shared_ptr<SceneUtil::ControllerSource> src;
|
||||||
src.reset(new NullAnimationTime);
|
src.reset(new NullAnimationTime);
|
||||||
SceneUtil::AssignControllerSourcesVisitor removeVisitor(src);
|
SceneUtil::ForceControllerSourcesVisitor removeVisitor(src);
|
||||||
node->accept(removeVisitor);
|
node->accept(removeVisitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -837,15 +837,19 @@ bool NpcAnimation::addOrReplaceIndividualPart(ESM::PartReferenceType type, int g
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
SceneUtil::ForceControllerSourcesVisitor assignVisitor(src);
|
||||||
|
node->accept(assignVisitor);
|
||||||
}
|
}
|
||||||
else if (type == ESM::PRT_Weapon)
|
else
|
||||||
|
{
|
||||||
|
if (type == ESM::PRT_Weapon)
|
||||||
src = mWeaponAnimationTime;
|
src = mWeaponAnimationTime;
|
||||||
else
|
else
|
||||||
src.reset(new NullAnimationTime);
|
src.reset(new NullAnimationTime);
|
||||||
|
|
||||||
SceneUtil::AssignControllerSourcesVisitor assignVisitor(src);
|
SceneUtil::AssignControllerSourcesVisitor assignVisitor(src);
|
||||||
node->accept(assignVisitor);
|
node->accept(assignVisitor);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,6 +121,21 @@ namespace SceneUtil
|
||||||
ctrl.setSource(mToAssign);
|
ctrl.setSource(mToAssign);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ForceControllerSourcesVisitor::ForceControllerSourcesVisitor()
|
||||||
|
: AssignControllerSourcesVisitor()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
ForceControllerSourcesVisitor::ForceControllerSourcesVisitor(std::shared_ptr<ControllerSource> toAssign)
|
||||||
|
: AssignControllerSourcesVisitor(toAssign)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void ForceControllerSourcesVisitor::visit(osg::Node&, Controller &ctrl)
|
||||||
|
{
|
||||||
|
ctrl.setSource(mToAssign);
|
||||||
|
}
|
||||||
|
|
||||||
FindMaxControllerLengthVisitor::FindMaxControllerLengthVisitor()
|
FindMaxControllerLengthVisitor::FindMaxControllerLengthVisitor()
|
||||||
: SceneUtil::ControllerVisitor()
|
: SceneUtil::ControllerVisitor()
|
||||||
, mMaxLength(0)
|
, mMaxLength(0)
|
||||||
|
|
|
@ -85,10 +85,20 @@ namespace SceneUtil
|
||||||
/// By default assigns the ControllerSource passed to the constructor of this class if no ControllerSource is assigned to that controller yet.
|
/// By default assigns the ControllerSource passed to the constructor of this class if no ControllerSource is assigned to that controller yet.
|
||||||
void visit(osg::Node& node, Controller& ctrl) override;
|
void visit(osg::Node& node, Controller& ctrl) override;
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
std::shared_ptr<ControllerSource> mToAssign;
|
std::shared_ptr<ControllerSource> mToAssign;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class ForceControllerSourcesVisitor : public AssignControllerSourcesVisitor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ForceControllerSourcesVisitor();
|
||||||
|
ForceControllerSourcesVisitor(std::shared_ptr<ControllerSource> toAssign);
|
||||||
|
|
||||||
|
/// Assign the wanted ControllerSource even if one is already assigned to the controller.
|
||||||
|
void visit(osg::Node& node, Controller& ctrl) override;
|
||||||
|
};
|
||||||
|
|
||||||
/// Finds the maximum of all controller functions in the given scene graph
|
/// Finds the maximum of all controller functions in the given scene graph
|
||||||
class FindMaxControllerLengthVisitor : public ControllerVisitor
|
class FindMaxControllerLengthVisitor : public ControllerVisitor
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue