@@ -319,7 +319,11 @@ class WindowSceneImpl : public WindowScene
319
319
{
320
320
camman.reset (new OgreBites::CameraMan (camNode));
321
321
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
323
327
}
324
328
325
329
if (!app->sceneMgr )
@@ -344,10 +348,18 @@ class WindowSceneImpl : public WindowScene
344
348
{
345
349
if (flags & SCENE_SEPERATE)
346
350
{
351
+ TextureManager& texMgr = TextureManager::getSingleton ();
352
+
347
353
MaterialManager::getSingleton ().remove (bgplane->getMaterial ());
348
354
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
+ }
351
363
}
352
364
353
365
if (_app->sceneMgr == sceneMgr && (flags & SCENE_SEPERATE))
@@ -694,6 +706,10 @@ class WindowSceneImpl : public WindowScene
694
706
695
707
void fixCameraYawAxis (bool useFixed, InputArray _up) CV_OVERRIDE
696
708
{
709
+ #if OGRE_VERSION >= ((1 << 16) | (11 << 8) | 5)
710
+ if (camman) camman->setFixedYaw (useFixed);
711
+ #endif
712
+
697
713
Vector3 up = Vector3::NEGATIVE_UNIT_Y;
698
714
if (!_up.empty ())
699
715
{
0 commit comments