jaaku1111
22-02-2008 02:29:59
Hey Guys,
Ok so i'm trying to integrate ET (2.2) into my application. I've compiled the demo and it works great, so I put this code in my createScene in my own project:
(exact copy from my example code that works fine)
So when I try and run my application the debug shows its crashing with:
at:
I think its complaining about the mSceneMgr being invalid, but I know its not, because I can use it right above this... unless its getting messed up going into the ET class.
I'm sort of migrating into c++ from python/c# so I might have something simple wrong... anyone have any ideas?
Ok so i'm trying to integrate ET (2.2) into my application. I've compiled the demo and it works great, so I put this code in my createScene in my own project:
ET::TerrainManager* mTerrainMgr;
ET::SplattingManager* mSplatMgr;
const ET::TerrainInfo* mTerrainInfo;
// create terrain manager
mTerrainMgr = new ET::TerrainManager(mSceneMgr);
mTerrainMgr->setLODErrorMargin(2, mCamera->getViewport()->getActualHeight());
mTerrainMgr->setUseLODMorphing(true, 0.2, "morphFactor");
int size = 193;
// create a fresh, mid-high terrain for editing
ET::TerrainInfo terrainInfo (size, size, vector<float>(size*size, 0.5f));
// set position and size of the terrain
terrainInfo.setExtents(AxisAlignedBox(0, 0, 0, 5000, 300, 5000));
// now render it
mTerrainMgr->createTerrain(terrainInfo);
(exact copy from my example code that works fine)
So when I try and run my application the debug shows its crashing with:
Unhandled exception at 0x7c812a5b in LoukiEngine.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0012eb50..
at:
TerrainImpl::TerrainImpl(SceneManager* sceneMgr, const string& name)
: mSceneMgr(sceneMgr), mTerrainLoaded(false), mIndexHandler(0), mInstanceName(name),
mViewportHeight(0), maxLODAtBorders(false)
{
mOpt.maxPixelError = 3;
mOpt.useLODMorph = false;
mOpt.factorC = 0.0f;
}
I think its complaining about the mSceneMgr being invalid, but I know its not, because I can use it right above this... unless its getting messed up going into the ET class.
I'm sort of migrating into c++ from python/c# so I might have something simple wrong... anyone have any ideas?