Ray assert failure at PagingLandScapeOctree::_getCullbounds

magiconexxx

08-02-2009 18:53:32

I am working with PLSM2 and am having an issue with the following rayquery:

const Real clickX = static_cast <Real> (mevent.state.X.abs) / mWindoz.Width;
const Real clickY = static_cast <Real> (mevent.state.Y.abs) / mWindoz.Height;

Ray mouseRay = mWindoz.mpMainCamera->getCameraToViewportRay( clickX, clickY);
pRayQuery = mWindoz.mpSceneManager->createRayQuery(mouseRay);
pRayQuery->setQueryTypeMask( SceneManager::ENTITY_TYPE_MASK );
pRayQuery->setWorldFragmentType( SceneQuery::WFT_SINGLE_INTERSECTION );
pRayQuery->setSortByDistance( true );
pRayQuery->setRay( mouseRay );

// Execute query
RaySceneQueryResult &result = pRayQuery->execute();
RaySceneQueryResult::iterator itr = result.begin();

if (itr != result.end() && itr->movable)
{
LogManager::getSingleton().logMessage("Hit movable object");
char name1[300];
sprintf(name1, "%s, %s", "movable object name: ", itr->movable->getName());
LogManager::getSingleton().logMessage(name1);

}

// Get results, create a node/entity on the position
if (itr != result.end() && itr->worldFragment )
{
CharacterManager *cm = CharacterManager::getSingletonPtr();
Character *ch = cm->getCharacterByName("robot5");
if(ch)
{
ch->SetPosition(itr->worldFragment->singleIntersection.x, itr->worldFragment->singleIntersection.y, itr->worldFragment->singleIntersection.z);
}

}


Running this code and clicking on anything in the scene - be it a node or the terrain itself - results in the following error:
/usr/include/OGRE/OgreAxisAlignedBox.h:246: void Ogre::AxisAlignedBox::setExtents(const Ogre::Vector3&, const Ogre::Vector3&): Assertion `(min.x <= max.x && min.y <= max.y && min.z <= max.z) && "The minimum corner of the box must be less than or equal to maximum corner"' failed.


I've attached an image of the debug stack as well:
[attachment=0]RayQueryAssertDebugStack.png[/attachment]

This only occurs when setting the QueryTypeMask to SceneManager::ENTITY_TYPE_MASK. Leaving the mask blank doesn't crash the application, but it never results in a movable object being selected, either. Is there something I am doing wrong with my code, or is this a bug with PLSM? I've tried a few iterations of this code as posted on these and the main forums, but nothing seems to work...