Aritmethic Exception // Terrain Example

Problems building or running the engine, queries about how to use features etc.
Post Reply
asgarciap
Gnoblar
Posts: 1
Joined: Tue May 01, 2018 11:18 pm

Aritmethic Exception // Terrain Example

Post by asgarciap »

Hi,
I'm trying to follow the Ogre Tutorial 3 - http://wiki.ogre3d.org/Basic+Tutorial+3 but I'm having an Aritmethic Exception when calling the method loadAllTerrain from Ogre::TerrainGroup class.

Code: Select all

	this->m_TerrainGroup->setFilenameConvention(Ogre::String("terrain"),Ogre::String("dat"));
        this->m_TerrainGroup->setOrigin(Ogre::Vector3::ZERO);
        
        this->configureTerrainDefaults(light);
        
        for(long x=0; x<=0; ++x)
                for(long y=0; y<=0; ++y)
                        this->defineTerrain(x,y);
                
        this->m_TerrainGroup->loadAllTerrains(true);
Here is the backtrace that gdb gave me:

Code: Select all

Creating resources for group Internal
All done
Terrain created; size=513 minBatch=33 maxBatch=65 treeDepth=4 lodLevels=5 leafLods=2

Program received signal SIGFPE, Arithmetic exception.
0x00007ffff61f4bd8 in Ogre::LinearResampler::scale (dst=..., src=...) at /home/arturogarcia/Descargas/ogre-1.10.11/OgreMain/src/OgreImageResampler.h:107
107             uint64 stepz = ((uint64)src.getDepth() << 48) / dst.getDepth();
(gdb) bt
#0  0x00007ffff61f4bd8 in Ogre::LinearResampler::scale (dst=..., src=...) at /home/arturogarcia/Descargas/ogre-1.10.11/OgreMain/src/OgreImageResampler.h:107
#1  Ogre::Image::scale (src=..., scaled=..., filter=filter@entry=Ogre::Image::FILTER_BILINEAR) at /home/arturogarcia/Descargas/ogre-1.10.11/OgreMain/src/OgreImage.cpp:674
#2  0x00007ffff61f8403 in Ogre::Image::resize (this=this@entry=0x555555f4df30, width=<optimized out>, height=<optimized out>, filter=filter@entry=Ogre::Image::FILTER_BILINEAR)
    at /home/arturogarcia/Descargas/ogre-1.10.11/OgreMain/src/OgreImage.cpp:578
#3  0x00007ffff69701c2 in Ogre::Terrain::prepare (this=0x555555f4df70, importData=...) at /home/arturogarcia/Descargas/ogre-1.10.11/Components/Terrain/src/OgreTerrain.cpp:879
#4  0x00007ffff697ab51 in Ogre::TerrainGroup::handleRequest (this=<optimized out>, req=0x555555f4e920, srcQ=<optimized out>)
    at /home/arturogarcia/Descargas/ogre-1.10.11/Components/Terrain/src/OgreTerrainGroup.cpp:672
#5  0x00007ffff63ea815 in Ogre::DefaultWorkQueueBase::RequestHandlerHolder::handleRequest (srcQ=0x555555789700, req=0x555555f4e920, this=0x555555f4d540)
    at /home/arturogarcia/Descargas/ogre-1.10.11/OgreMain/include/OgreWorkQueue.h:538
#6  Ogre::DefaultWorkQueueBase::processRequest (this=this@entry=0x555555789700, r=r@entry=0x555555f4e920) at /home/arturogarcia/Descargas/ogre-1.10.11/OgreMain/src/OgreWorkQueue.cpp:669
#7  0x00007ffff63eb51f in Ogre::DefaultWorkQueueBase::processRequestResponse (this=this@entry=0x555555789700, r=r@entry=0x555555f4e920, synchronous=synchronous@entry=true)
    at /home/arturogarcia/Descargas/ogre-1.10.11/OgreMain/src/OgreWorkQueue.cpp:535
#8  0x00007ffff63ebeef in Ogre::DefaultWorkQueueBase::addRequest (this=this@entry=0x555555789700, channel=<optimized out>, requestType=requestType@entry=1, rData=..., 
    retryCount=retryCount@entry=0 '\000', forceSynchronous=forceSynchronous@entry=true, idleThread=false) at /home/arturogarcia/Descargas/ogre-1.10.11/OgreMain/src/OgreWorkQueue.cpp:240
#9  0x00007ffff697b301 in Ogre::TerrainGroup::loadTerrainImpl (this=this@entry=0x555555f4da30, slot=<optimized out>, synchronous=synchronous@entry=true)
    at /home/arturogarcia/Descargas/ogre-1.10.11/Components/Terrain/src/OgreTerrainGroup.cpp:317
#10 0x00007ffff697b3b7 in Ogre::TerrainGroup::loadAllTerrains (this=0x555555f4da30, synchronous=true)
    at /home/arturogarcia/Descargas/ogre-1.10.11/Components/Terrain/src/OgreTerrainGroup.cpp:252
Does anyone have an idea of what could be wrong?
There is no error or warnings when compiling and the ogre output seems to be ok.
I would really appreciate any help here.
Regards
Post Reply