Strange crash with RaySceneQuery

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
el3ktro
Gnoblar
Posts: 5
Joined: Wed Jul 07, 2010 12:06 am

Strange crash with RaySceneQuery

Post by el3ktro »

Hello,
I have a very strange crash in my iPad app with a RaySceneQuery. To handle the touch input, I use two different SceneQueries, a RaySceneQuery for a single touch and a PlaneBoundedVolumeListSceneQuery for a double touch, so you can select more than one object at once.

In my init method, I'm initializing both queries like this:

Code: Select all

raySceneQuery = ogreSceneManager->createRayQuery(Ogre::Ray()); 
raySceneQuery->setSortByDistance(true);
raySceneQuery->setQueryTypeMask(Ogre::SceneManager::ENTITY_TYPE_MASK);
			
volumeSceneQuery = ogreSceneManager->createPlaneBoundedVolumeQuery(Ogre::PlaneBoundedVolumeList());
volumeSceneQuery->setQueryTypeMask(Ogre::SceneManager::ENTITY_TYPE_MASK);
Then in the two touch handling methods, I use them like this:

Code: Select all

processSingleTouch() {
Ogre::Ray ray = cam->getCameraToViewportRay(Ogre::Real(x), Ogre::Real(y));
raySceneQuery->setRay(ray);
Ogre::RaySceneQueryResult& result = raySceneQuery->execute(); }
and

Code: Select all

processDoubleTouuch() {
Ogre::PlaneBoundedVolumeList volumes;
volumes.push_back(cam->getCameraToViewportBoxVolume(x1,y1,x2,y2,false));
volumeSceneQuery->setVolumes(volumes);
Ogre::SceneQueryResult& result = volumeSceneQuery->execute(); }
Everything is working fine, as long as I don't use them both. I can use processSingleTouch() without problems, and I can use processDoubleTouch() without any problems. But when I have used processDoubleTouch() and I'm using processSingleTouch() TWICE afterwards, it crashes with raySceneQuery->execute() and EXC_BAD_ACCESS.

I have absolutely no idea why this happens. I quad-checked the code, even some programmer friends looked over it and we just can't find an error. Maybe I'm using them wrong? Maybe it's even a bug in Ogre? Has anyone every experienced a similar problem?

Any help would be greatly appreciated!
wfmarques
Gnoblar
Posts: 1
Joined: Mon Jul 04, 2011 1:43 pm

Re: Strange crash with RaySceneQuery

Post by wfmarques »

You found any solution ? I has same problem :-(