Skip to content

Commit d0198e5

Browse files
committed
Merge pull request #1942 from paroj:ovisup
2 parents 34caac7 + 388a79b commit d0198e5

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

modules/ovis/src/ovis.cpp

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,11 @@ class WindowSceneImpl : public WindowScene
319319
{
320320
camman.reset(new OgreBites::CameraMan(camNode));
321321
camman->setStyle(OgreBites::CS_ORBIT);
322-
camNode->setFixedYawAxis(true, Vector3::NEGATIVE_UNIT_Y);
322+
#if OGRE_VERSION >= ((1 << 16) | (11 << 8) | 5)
323+
camman->setFixedYaw(false);
324+
#else
325+
camNode->setFixedYawAxis(true, Vector3::NEGATIVE_UNIT_Y); // OpenCV +Y in Ogre CS
326+
#endif
323327
}
324328

325329
if (!app->sceneMgr)
@@ -344,10 +348,18 @@ class WindowSceneImpl : public WindowScene
344348
{
345349
if (flags & SCENE_SEPERATE)
346350
{
351+
TextureManager& texMgr = TextureManager::getSingleton();
352+
347353
MaterialManager::getSingleton().remove(bgplane->getMaterial());
348354
bgplane.release();
349-
String texName = sceneMgr->getName() + "_Background";
350-
TextureManager::getSingleton().remove(texName, RESOURCEGROUP_NAME);
355+
String texName = "_"+sceneMgr->getName() + "_DefaultBackground";
356+
texMgr.remove(texName, RESOURCEGROUP_NAME);
357+
358+
texName = sceneMgr->getName() + "_Background";
359+
if(texMgr.resourceExists(texName, RESOURCEGROUP_NAME))
360+
{
361+
texMgr.remove(texName, RESOURCEGROUP_NAME);
362+
}
351363
}
352364

353365
if(_app->sceneMgr == sceneMgr && (flags & SCENE_SEPERATE))
@@ -694,6 +706,10 @@ class WindowSceneImpl : public WindowScene
694706

695707
void fixCameraYawAxis(bool useFixed, InputArray _up) CV_OVERRIDE
696708
{
709+
#if OGRE_VERSION >= ((1 << 16) | (11 << 8) | 5)
710+
if(camman) camman->setFixedYaw(useFixed);
711+
#endif
712+
697713
Vector3 up = Vector3::NEGATIVE_UNIT_Y;
698714
if (!_up.empty())
699715
{

0 commit comments

Comments
 (0)