problem with setSkyBox

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
dowi
Halfling
Posts: 48
Joined: Wed Sep 07, 2011 3:37 am

problem with setSkyBox

Post by dowi »

hi

im working with ogre 1.8 branch (downloaded and compiled couple of days ago) on the iphone

i have a problem with SetSkyBox the second time i call it.

it crashes at

Code: Select all

Pass* pass = m->getBestTechnique()->getPass(0);
the call stack is :

Code: Select all

#0	0x008e586e in std::vector<Ogre::Pass*, Ogre::STLAllocator<Ogre::Pass*, Ogre::CategorisedAllocPolicy<(Ogre::MemoryCategory)0> > >::size() const at /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/include/c++/4.2.1/bits/stl_vector.h:400
#1	0x008e2c08 in Ogre::Technique::getPass(unsigned short) ()
#2	0x0079c1a0 in Ogre::SceneManager::_setSkyBox(bool, std::string const&, float, unsigned char, Ogre::Quaternion const&, std::string const&) ()
#3	0x0079da56 in Ogre::SceneManager::setSkyBox(bool, std::string const&, float, bool, Ogre::Quaternion const&, std::string const&) ()
#4	0x0008e596 in OgreApp::SetSkyBox(std::string) at /Users/dowi/Documents/QRAR_nextGen/qr3d/QRAR_nextGen/jni/SimulationManager/Ogre/OgreApp.cpp:931
what can the problem be?
thanks allot!
User avatar
mmixLinus
Silver Sponsor
Silver Sponsor
Posts: 199
Joined: Thu Apr 21, 2011 3:08 pm
Location: Lund, Sweden
x 12

Re: problem with setSkyBox

Post by mmixLinus »

Hi dowi,

did you get it working? If not, could you post a little of your code in OgreApp::SetSkyDome() and tell us what parameter values that SceneManager::setSkyDome() is receiving?

Thanks
/mmixLinus
Powered by Ogre3D:
MMiX.Me 3D - 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
YouTube|Facebook
Shamun
Gnoblar
Posts: 19
Joined: Sun Aug 01, 2010 12:45 am
Location: Israel
x 5

Re: problem with setSkyBox

Post by Shamun »

Hi it's dowi.

Here is the SetSkyBox code:

Code: Select all

 void OgreApp::SetSkyBox(string skyBoxName)
{
    
    ScreenManager::GetInstancePtr()->ShowView(screenProgressEnum, "Loading...");
    
//    mSceneMgr->setSkyBoxEnabled(false);
//    mSceneMgr->setSkyBox(false, "");

    StringVector res = ResourceGroupManager::getSingleton().getResourceGroups();
    StringVector::iterator itr;
    for (itr = res.begin(); itr != res.end(); itr++)
    {
        ResourceGroupManager::getSingleton().unloadUnreferencedResourcesInGroup((*itr));
    }

    if (skyBoxName != "")
    {
        mSceneMgr->setSkyBox(true, skyBoxName, 5000, true);
    }

    ScreenManager::GetInstancePtr()->HideView(screenProgressEnum);
    
    //mSceneMgr->setSkyDome(true, skyBoxName, 5,60);  
}
User avatar
mmixLinus
Silver Sponsor
Silver Sponsor
Posts: 199
Joined: Thu Apr 21, 2011 3:08 pm
Location: Lund, Sweden
x 12

Re: problem with setSkyBox

Post by mmixLinus »

Sorry, can't really help you, other than with an obvious guess:
- the name you are specifying is not a valid material name
- you are unloading the material before using it

I think it's unclear if m->getBestTechnique()->getPass(0) is asserting because the valid pointer m is a material with 0 Passes, or because m is an invalid pointer.

It works in 1.7.x?
Try the Help forum?

/mmixLinus
Powered by Ogre3D:
MMiX.Me 3D - 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
YouTube|Facebook