Dugi
01-08-2013 11:26:17
I changed the name of this topic, because I was helped with this, but a new issue came, see bellow. Original name was Help! Segfault in PagedGeometry::Update().
I was trying to place some trees using PagedGeometry accordingly to the first tutorial, but I came to a problem I could not figure out. Until I came to the trees->update() part, everything was fine (nothing displayed, not sure if wasn't supposed to display something after using trees->setPageLoader(treeLoader) even without using ->update).
It caused crashes even if I placed there no objects, or just one on zero coordinates. It seems to crash in the same way even if I don't assign it a PageLoader. Here's the code:
Regarding the rest of code, it was based on the classical TutorialApplication and BaseApplication from clean project, adding a terrain and some other entities, but they had different names and it was pretty basic.
I tried to use valgrind on it, and this is what it told about the crash:
I am using ogre-paged-1.1.4, with Ogre 1.8.1, compiled on Linux Ubuntu 12.10, building with cmake version 2.8.9, using Qt but the error comes also without using it at all, video card ATI HD5470 if that matters.
Sorry if it is noobish question.
I was trying to place some trees using PagedGeometry accordingly to the first tutorial, but I came to a problem I could not figure out. Until I came to the trees->update() part, everything was fine (nothing displayed, not sure if wasn't supposed to display something after using trees->setPageLoader(treeLoader) even without using ->update).
It caused crashes even if I placed there no objects, or just one on zero coordinates. It seems to crash in the same way even if I don't assign it a PageLoader. Here's the code:
Forests::PagedGeometry *trees = new Forests::PagedGeometry();
trees->setCamera(mCamera);
trees->setPageSize(50);
trees->setInfinite();
trees->addDetailLevel<Forests::BatchPage>(150, 30);
trees->addDetailLevel<Forests::ImpostorPage>(400, 50);
Forests::TreeLoader3D *treeLoader = new Forests::TreeLoader3D(trees, Forests::TBounds(0, 0, 1500, 1500));
Ogre::Entity *myEntity = mSceneMgr->createEntity("Tree", "tree-forest-1.mesh");
Ogre::Vector3 position;
Ogre::Radian yaw;
Ogre::Real scale;
//...
position = Ogre::Vector3(0,0,0);
yaw = Ogre::Degree(0);
scale = Ogre::Real(4);
treeLoader->addTree(myEntity, position, yaw, scale);
//...
trees->setPageLoader(treeLoader);
//So far, no segfaults occurred.
//...
//In frameRenderingQueued
trees->update();
//Caused a segfault
Regarding the rest of code, it was based on the classical TutorialApplication and BaseApplication from clean project, adding a terrain and some other entities, but they had different names and it was pretty basic.
I tried to use valgrind on it, and this is what it told about the crash:
==6869== Process terminating with default action of signal 11 (SIGSEGV)
==6869== General Protection Fault
==6869== at 0x4FD27D7: Ogre::Camera::getDerivedPosition() const (OgreCamera.cpp:524)
==6869== by 0x43EBC2: Forests::PagedGeometry::update() (in /home/dugi/Documents/Informa/clean_ogre_cmake_project/dist/bin/OgreApp)
==6869== by 0x42664C: TutorialApplication::frameRenderingQueued(Ogre::FrameEvent const&) (TutorialApplication.cpp:339)
==6869== by 0x5169CEC: Ogre::Root::_fireFrameRenderingQueued(Ogre::FrameEvent&) (OgreRoot.cpp:841)
==6869== by 0x516A17F: Ogre::Root::_fireFrameRenderingQueued() (OgreRoot.cpp:896)
==6869== by 0x516A1B1: Ogre::Root::_updateAllRenderTargets() (OgreRoot.cpp:1395)
==6869== by 0x516A26F: Ogre::Root::renderOneFrame() (OgreRoot.cpp:978)
==6869== by 0x516A2B4: Ogre::Root::startRendering() (OgreRoot.cpp:968)
==6869== by 0x41B7D8: BaseApplication::go() (BaseApplication.cpp:205)
==6869== by 0x41B357: main (TutorialApplication.cpp:364)
I am using ogre-paged-1.1.4, with Ogre 1.8.1, compiled on Linux Ubuntu 12.10, building with cmake version 2.8.9, using Qt but the error comes also without using it at all, video card ATI HD5470 if that matters.
Sorry if it is noobish question.