mogre & newt LOD mesh crashes simulation

oramia

01-11-2009 19:55:08

Hey guys, I am using newt and mogre and I am very happy so far for my simple requirements. I had run into a problem though, when I use ManualLOD for my mesh, game crashed when LOD kicks in, and I wonder why this is so (no exception thrown from c++ code, direct crash).
(I know that I am using Mogre instead of Ogre, but the crash is possibly coming thorugh ogre-newt integration, how can I be sure on where the problem is originating?)

Here's my code:

MeshPtr mesh = MeshManager.Singleton.Load("mainmesh.mesh", ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME);
mesh.CreateManualLodLevel(5, "mesh-LOD1.mesh");
mesh.CreateManualLodLevel(10, "mesh-LOD2.mesh");*/
entity = sceneMgr.CreateEntity("entity" + (_entityCount++), mesh.Name);

node = sceneMgr.RootSceneNode.CreateChildSceneNode();
node.AttachObject(entity);
node.SetScale(size);

MogreNewt.ConvexCollision col = new MogreNewt.CollisionPrimitives.Box(_world, size);
col.CalculateInertialMatrix(out inertia, out offset);
inertia = inertia * mass;
MogreNewt.Body bod = new MogreNewt.Body(_world, col);
col.Dispose();

bod.AttachNode(node);


same code works without a problem if I comment out line 2 and 3. Do you have any idea what may be wrong?

oramia

04-11-2009 19:14:46

no idea? I know it is mogre c# code, but should be almost the same as C++ code. Is anyone using LOD meshes with OgreNewt succesfully? I'll appreciate some sample code if this is possible.
Cheers!