TriangleMesh as Terrain not working

Springare

18-12-2007 16:20:51

Hi im working on a game projekt whit my friend and wanna use a mesh from 3smax that we have exported to ogres .mesh file format. the problem is all object just fall straight trought and lands on the floor under the mesh.

and here is the code im using to initialize the NxOgre and make a ogrehead dummy:


World *pPhysicWorld = new World("log: html, framelistner: yes");

Scene *pNxScene = pPhysicWorld->createScene("WorldScene", mSceneMgr, "gravity: yes, floor: yes");

Body *pBody = pNxScene->createBody("OgreHead.mesh", new CubeShape(0.5f), Vector3(0.0f,1000.0f,0.0f), "mass: 500");

m_pLevel = new Level();
if(m_pLevel != NULL)
m_pLevel->Initialize("Level01", pNxScene);


and the code im using for the level is:

bool Level::Initialize(Ogre::String sLevelName, Scene* pNxScene)
{
m_pNxScene = pNxScene;
m_sLevelName = sLevelName;
m_sMeshName = sLevelName + ".mesh";

Body *pBody = m_pNxScene->createBody(m_sMeshName, new TriangleMeshShape(m_sMeshName), Vector3(0.0f, 0.0f, 0.0f), "static: yes");
return true;
}


please, is there anyone who can help me and find the error?


//Springare

betajaen

18-12-2007 17:07:11

Is the mesh centered? Are the normals facing the right way? Is the right mesh? Did you see what it looks like in the Remote Debugger?

mr_burns

21-12-2007 10:58:32

Springare,

Is it possible for you to zip the project/solution, complete with the two assets (ogrehead and level01), upload to the web, and post a link here?

Also if you could include the .max file (or whatever native modelling file) so we could rule out an asset issue first.

Betjaen:

Is there anything going on with the assignment operator in the Scene class that could be causing this? (it should be getting invoked in the Level::Initialise() method.

betajaen

21-12-2007 12:00:05

If I remember correctly. The Ogre Mesh is huge, it's like 500 meters across at least. And your using a 50cm cube with it. No wonder it seems like it's falling through the leve.