[Solved] Adding a meshbuffer to a mesh

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
wetneb
Posts: 3
Joined: Mon Apr 16, 2007 12:05 pm

[Solved] Adding a meshbuffer to a mesh

Post by wetneb »

Hi,

I've a problem using meshes and mesh buffers. I want to add a mesh buffer to a mesh :

Code: Select all

scene::SMesh *testMesh = new scene::SMesh;
scene::SMeshBufferLightMap *testBuffer = new scene::SMeshBufferLightMap;
testMesh->addMeshBuffer(testBuffer);
This codes returns this error (when executed) :
../../include/irrArray.h:270: T& irr::core::array<T, TAlloc>::operator[](irr::u32) [with T = irr::video::SMaterial, TAlloc = irr::core::irrAllocator<irr::video::SMaterial>]: Assertion `!(index>=used)' failed.
How to resolve this problem ?

Thanks !
Last edited by wetneb on Thu Mar 27, 2008 4:29 pm, edited 2 times in total.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Are you absolutely sure that the code you post results in the assertion you show? I'm confident that it cannot. The assertion you show is happening when a core::array<video::SMaterial> is being accessed out of bounds. None of the code that you show has a array of that type.

You should be able to use your debugger to get the call stack at the time of the assertion. If you look up the stack, you may find some code that causes the failure.

Travis
wetneb
Posts: 3
Joined: Mon Apr 16, 2007 12:05 pm

Post by wetneb »

Oops :oops:
The exception was thrown while rendering...
This code was included in a class which was child of CMeshSceneNode and I didn't called copyMaterials() after loading a mesh...
Thanks a lot, the problem is resolved !
Post Reply