Commit 297e8be9 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #2175 from dnandha:ovis-fix-anim-multi

parents 3830f186 173b7f51
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <opencv2/calib3d.hpp> #include <opencv2/calib3d.hpp>
#include <opencv2/core/utils/configuration.private.hpp> #include <opencv2/core/utils/configuration.private.hpp>
namespace cv namespace cv
{ {
namespace ovis namespace ovis
...@@ -277,7 +278,7 @@ class WindowSceneImpl : public WindowScene ...@@ -277,7 +278,7 @@ class WindowSceneImpl : public WindowScene
RenderWindow* rWin; RenderWindow* rWin;
Ptr<OgreBites::CameraMan> camman; Ptr<OgreBites::CameraMan> camman;
Ptr<Rectangle2D> bgplane; Ptr<Rectangle2D> bgplane;
std::unordered_map<String, Controller<Real>*> frameCtrlrs; std::unordered_map<AnimationState*, Controller<Real>*> frameCtrlrs;
Ogre::RenderTarget* depthRTT; Ogre::RenderTarget* depthRTT;
int flags; int flags;
...@@ -600,9 +601,9 @@ public: ...@@ -600,9 +601,9 @@ public:
animstate->setEnabled(true); animstate->setEnabled(true);
animstate->setLoop(loop); animstate->setLoop(loop);
if (frameCtrlrs.find(animname) != frameCtrlrs.end()) return; if (frameCtrlrs.find(animstate) != frameCtrlrs.end()) return;
frameCtrlrs.insert({ frameCtrlrs.insert({
animname, animstate,
Ogre::ControllerManager::getSingleton().createFrameTimePassthroughController( Ogre::ControllerManager::getSingleton().createFrameTimePassthroughController(
Ogre::AnimationStateControllerValue::create(animstate, true) Ogre::AnimationStateControllerValue::create(animstate, true)
) )
...@@ -620,8 +621,8 @@ public: ...@@ -620,8 +621,8 @@ public:
animstate->setEnabled(false); animstate->setEnabled(false);
animstate->setTimePosition(0); animstate->setTimePosition(0);
Ogre::ControllerManager::getSingleton().destroyController(frameCtrlrs[animname]); Ogre::ControllerManager::getSingleton().destroyController(frameCtrlrs[animstate]);
frameCtrlrs.erase(animname); frameCtrlrs.erase(animstate);
} }
void setEntityProperty(const String& name, int prop, const String& value) CV_OVERRIDE void setEntityProperty(const String& name, int prop, const String& value) CV_OVERRIDE
...@@ -659,7 +660,7 @@ public: ...@@ -659,7 +660,7 @@ public:
Entity* ent = dynamic_cast<Entity*>(node.getAttachedObject(name)); Entity* ent = dynamic_cast<Entity*>(node.getAttachedObject(name));
CV_Assert(ent && "invalid entity"); CV_Assert(ent && "invalid entity");
ent->getSkeleton()->setBlendMode(static_cast<Ogre::SkeletonAnimationBlendMode>(value[0])); ent->getSkeleton()->setBlendMode(static_cast<Ogre::SkeletonAnimationBlendMode>(int(value[0])));
break; break;
} }
default: default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment