meshShape from manually created mesh

Grom

10-02-2007 20:07:49

I'm in the process of integrating nxOgre with PLSM2. I've grabbed the vertex data per tile from the terrain. A tile consists of 8,192 faces (from 4225 vertices). I'm assuming that the next step in this process is to create a body with a meshShape made from this vertex data (and then eventually cook that and just load the nxs file). How do I create a meshShape from a mesh I've created in memory?

Furthermore, the PLSM2 creates HUGE landscapes, what would be the best way to do collision upon it? I'm assuming meshShapes are best because they are static. Should I only keep bodies for the tiles surrounding the player? I imagine covering the entire map in meshShapes would slow things down.

betajaen

10-02-2007 20:27:12

Probably the best way would be to adapt the heightmapShape to work with PLSM2. All the code is there, it's just geared up for the Ogre terrain, I'm sure it's adaptable for it.

PhysX can page meshes in and out from what I hear, but NxOgre hasn't implemented it yet. So there is a problem there. I suppose you could just generate the tiles to a NXS files. Then use the meshShape to read it in, once the player has moved out a certain tile then delete that body, and load in the others. It should be fairly fast to work with.

Else you could try and have a go at wrapping the paging code for me ;)

Grom

10-02-2007 21:08:30

does the heightmap code demonstrate how to create the meshShape? The version of nxOgre I have doesn't include the heightShape (or the cloth stuff), and I don't want to start using anything new just yet (as I follow the if-it-aint-broke-don't-fix-it philosophy). If I download the 0.4 RC3 stuff and the tutorials, what files contain the heightmapShape stuff?

betajaen

10-02-2007 21:54:12

A heightmap is a meshShape, it's in NxOgre_shape.cpp

[Later-Edit]

Check your PM, I have a late Christmas present for you.