[Bleeding] '21 NXS meshes problem thread - Huge success

betajaen

10-05-2008 09:30:06

Preamble

It seems a quite a number of people are having problems with the new resource system, or having corrupted files being converted by flour. These two problems may be related or not.

To aid in the speed of this; Can I ask those who are involved use to do these tests, so I can reach a baseline.

The Test

1. Install Flour (and the 2.8.0 installer provided), and use it with the "meshtest.mesh" file and convert it to into convex ""meshtest.convex.nxs" and a triangle shape ""meshtest.triangle.nxs".

2. Place both of these nxs files into your applications directory. We don't need meshtest.mesh, so you can discard it.

3. Modify your code to run either of these piece of code.

For Convexes
// Convex Load Test 1.
::NxOgre::Resources::ResourceSystem::getSingleton()->addMeshAs("file://meshtest.convex.nxs", "meshtest-convex");

// Convex Test 1.
mScene->createActor("convex-test1", new Convex("meshtest-convex"), Vector3(0, 10, 0), "static: yes");

// Convex Test 2.
::NxOgre::Resources::Mesh* convex_test = ::NxOgre::Resources::ResourceSystem::getMesh("meshtest-convex");
mScene->createActor("convex-test2", new Convex(convex_test), Vector3(10, 10, 0), "static: yes");


// TriangleMesh Load Test 1.
::NxOgre::Resources::ResourceSystem::getSingleton()->addMeshAs("file://meshtest.triangle.nxs", "meshtest-triangle");

// TriangleMesh Test 1.
mScene->createActor("triangle-test1", new TriangleMesh("meshtest"), Vector3(0, 20, 0), "static: yes");

// TriangleMesh Test 2.
::NxOgre::Resources::Mesh* triangle_test = ::NxOgre::Resources::ResourceSystem::getMesh("meshtest-triangle");
mScene->createActor("triangle-test2", new Convex(convex_test), Vector3(10, 20, 0), "static: yes");


4. You probably have to replace "mScene" with the name or function to get your Scene pointer, otherwise you will not need to change any other code.

5. It may be better to split each test up separately; Include the Load code and test 1, then try it again with the load code and test 2. Then switch to the other type of mesh and repeat.

Your results

Please reply back with if your tests actually passed or not with any stack traces, screen-shots, code dumps, and anything you feel is relevant to the crashing.


Get to it. ;)

Fred

10-05-2008 21:10:23

Here we go!

No test works :(
But there is a new error :)

NxOgre::Resources::ResourceSystem::getSingleton()->adMeshAs("file://meshtest.triangle.nxs", "meshtest-triangle");

m_pBody = m_Level.getGameEnv().m_pScene->createBody("test", new
NxOgre::TriangleMesh("meshtest-triangle"), Ogre::Vector3(0,20,0), "static: yes");


The error is in NxOgre::Actor.cpp

if(shape->getTypeHash() == NxOgreClass_Shape)

The same for convex.

Why Convex and TriangleMesh have to be static?

betajaen

10-05-2008 21:14:55

Convex doesn't. It's just for testing.

I don't get that error, which version are you using? Please tell me it's 1.0'21.

Fred

10-05-2008 22:43:23

Yes it is 1.0'21
At least I think so.

FriedChicken

11-05-2008 14:30:51

Convex Test 1, crashed at nxogreshapemeshes.cpp:

mShapeDescription.meshData = mMesh->mMesh.mConvexMesh;


stack trace:

> MyGame.exe!NxOgre::Convex::createShape(NxArray<NxShapeDesc *,NxAllocatorDefault> & shapes={...}, unsigned int index=0, NxOgre::Scene * scene=0x0fe32328) 行96 + 0xc 字节 C++
MyGame.exe!NxOgre::Actor::_createActor(NxOgre::Shape * shape=0x125bf0a8, const NxOgre::Pose & pose={...}, NxOgre::ActorParams params={...}) 行308 + 0x1c 字节 C++
MyGame.exe!NxOgre::Actor::Actor(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & name="convex-test1", NxOgre::Scene * scene=0x0fe32328, NxOgre::Shape * shape=0x125bf0a8, const NxOgre::Pose & pose={...}, const NxOgre::ActorParams & params={...}) 行237 C++
MyGame.exe!NxOgre::Scene::createActor(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & identifier="convex-test1", NxOgre::Shape * firstShapeDescription=0x125bf0a8, const NxOgre::Pose & pose={...}, const NxOgre::ActorParams & params={...}) 行833 + 0x3f 字节 C++
MyGame.exe!Application::createScene() 行191 + 0x159 字节 C++
MyGame.exe!Application::go() 行260 C++
MyGame.exe!WinMain(HINSTANCE__ * hInst=0x00400000, HINSTANCE__ * __formal=0x00000000, char * strCmdLine=0x00151f04, HINSTANCE__ * __formal=0x00000000) 行18 C++
MyGame.exe!__tmainCRTStartup() 行589 + 0x35 字节 C
MyGame.exe!WinMainCRTStartup() 行414 C
kernel32.dll!7c816fd7()


Convex Test 2, crashed at dbgheap.c

__finally { //<--------------------------here
/* unlock the heap
*/
_munlock(_HEAP_LOCK);
}


stack trace:

PhysXCore.dll!117a813e()
[下é

FriedChicken

11-05-2008 14:42:56

TriangleMesh Test 1, crashed at nxogreshapemeshes.cpp:


mShapeDescription.meshData = mMesh->mMesh.mTriangleMesh;


stack trace:


> MyGame.exe!NxOgre::TriangleMesh::createShape(NxArray<NxShapeDesc *,NxAllocatorDefault> & shapes={...}, unsigned int index=0, NxOgre::Scene * scene=0x0fe32328) 行195 + 0xc 字节 C++
MyGame.exe!NxOgre::Actor::_createActor(NxOgre::Shape * shape=0x125bf288, const NxOgre::Pose & pose={...}, NxOgre::ActorParams params={...}) 行308 + 0x1c 字节 C++
MyGame.exe!NxOgre::Actor::Actor(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & name="triangle-test1", NxOgre::Scene * scene=0x0fe32328, NxOgre::Shape * shape=0x125bf288, const NxOgre::Pose & pose={...}, const NxOgre::ActorParams & params={...}) 行237 C++
MyGame.exe!NxOgre::Scene::createActor(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & identifier="triangle-test1", NxOgre::Shape * firstShapeDescription=0x125bf288, const NxOgre::Pose & pose={...}, const NxOgre::ActorParams & params={...}) 行833 + 0x3f 字节 C++
MyGame.exe!Application::createScene() 行191 + 0x159 字节 C++
MyGame.exe!Application::go() 行260 C++
MyGame.exe!WinMain(HINSTANCE__ * hInst=0x00400000, HINSTANCE__ * __formal=0x00000000, char * strCmdLine=0x00151f04, HINSTANCE__ * __formal=0x00000000) 行18 C++
MyGame.exe!__tmainCRTStartup() 行589 + 0x35 字节 C
MyGame.exe!WinMainCRTStartup() 行414 C
kernel32.dll!7c816fd7()


TriangleMesh Test 2, crashed at dbgheap.c:


__finally {
/* unlock the heap
*/
_munlock(_HEAP_LOCK);
}


stack trace:


PhysXCore.dll!117a813e()
[下é

FriedChicken

11-05-2008 14:58:38

And when I set break point at

Resources::Mesh* triangle_test = Resources::ResourceSystem::getSingleton()->getMesh("meshtest-triangle");


the trace of it is:

- triangle_test 0x125bedc8 {mMesh={...} } NxOgre::Resources::Mesh *
- mMesh {mTriangleMesh=0xcdcdcdcd mConvexMesh=0xcdcdcdcd mSkeletonMesh=0xcdcdcdcd ...} NxOgre::Resources::Mesh::MeshData
- mTriangleMesh 0xcdcdcdcd NxTriangleMesh *
__vfptr CXX0030: Error: unable to evaluate expression
- mConvexMesh 0xcdcdcdcd NxConvexMesh *
__vfptr CXX0030: Error: unable to evaluate expression
- mSkeletonMesh 0xcdcdcdcd NxCCDSkeleton *
__vfptr CXX0030: Error: unable to evaluate expression
- mClothMesh 0xcdcdcdcd NxClothMesh *
__vfptr CXX0030: Error: unable to evaluate expression
- mSoftBodyMesh 0xcdcdcdcd NxSoftBodyMesh *
__vfptr CXX0030: Error: unable to evaluate expression
mType -842150451 NxOgre::Resources::MeshType
mNbReferences 3452816846 unsigned int
mTextureCoordinates 0xcdcdcdcd Betajaen::SharedList<Betajaen::Vector3<float>,Betajaen::SharedAllocator> *
- mMaterialAlias 0xcdcdcdcd {mMaterials={...} } NxOgre::Resources::MaterialAlias *
- mMaterials {_Tree=??? _Usage=??? } Betajaen::SharedMap<unsigned int,NxOgre::Material,Betajaen::SharedAllocator>
_Tree CXX0076: Error:
_Usage CXX0030: Error: unable to evaluate expression


And when using Convex, the trace is almost the same.

break at:

Resources::Mesh* convex_test =Resources::ResourceSystem::getSingleton()->getMesh("meshtest-convex");


trace:

- convex_test 0x125bed68 {mMesh={...} } NxOgre::Resources::Mesh *
- mMesh {mTriangleMesh=0xcdcdcdcd mConvexMesh=0xcdcdcdcd mSkeletonMesh=0xcdcdcdcd ...} NxOgre::Resources::Mesh::MeshData
- mTriangleMesh 0xcdcdcdcd NxTriangleMesh *
__vfptr CXX0030: Error: unable to evaluate expression
- mConvexMesh 0xcdcdcdcd NxConvexMesh *
__vfptr CXX0030: Error: unable to evaluate expression
- mSkeletonMesh 0xcdcdcdcd NxCCDSkeleton *
__vfptr CXX0030: Error: unable to evaluate expression
- mClothMesh 0xcdcdcdcd NxClothMesh *
__vfptr CXX0030: Error: unable to evaluate expression
- mSoftBodyMesh 0xcdcdcdcd NxSoftBodyMesh *
__vfptr CXX0030: Error: unable to evaluate expression
mType -842150451 NxOgre::Resources::MeshType
mNbReferences 3452816846 unsigned int
mTextureCoordinates 0xcdcdcdcd Betajaen::SharedList<Betajaen::Vector3<float>,Betajaen::SharedAllocator> *
- mMaterialAlias 0xcdcdcdcd {mMaterials={...} } NxOgre::Resources::MaterialAlias *
- mMaterials {_Tree=??? _Usage=??? } Betajaen::SharedMap<unsigned int,NxOgre::Material,Betajaen::SharedAllocator>
_Tree CXX0076: Error:
_Usage CXX0030: Error: unable to evaluate expression

betajaen

11-05-2008 17:23:46

Thanks UnhealthyChicken, this helps. It's bound to be a pointer that isn't initialised, I'll have a look once I'm sure this new BetajaenCC code works properly.

FriedChicken

14-05-2008 04:08:53

eager to know the solution

Fred

15-05-2008 11:50:49

Seems something was wrong with my tests. Now I'm getting the same errors as FriedChicken. But what could be the reason for these erors. If it works at your PC betajaen, it should work at ours, too. Perhaps there is a problem converting the ogre meshes into nxs-files. Perhaps you can upload a nxs-file. So we can exclude that something is wrong with the converter.

FriedChicken

16-05-2008 10:31:35

I don't know whether the problem is generated by Flour or by Bleeding.

gugus

18-05-2008 10:44:08

I might have found something.

Here is AddMeshAs:
void ResourceSystem::addMeshAs(const ResourceIdentifier& ri, const NxString& MeshIdentifier) {
Resource* r = get(ri, RA_Read);
Mesh* mesh = NxNew(Mesh)(r);
mMeshes.Insert(MeshIdentifier, mesh);
delete r;
}


ResourceSystem::get return ResourceManagers[prefix]->get(ri, ra); and here is "get " in RessourceManager:
virtual Resource* get(const ResourceIdentifier&, ResourceAccess) {return 0;}
So "r" is always 0,and the mesh can't be loaded.

FriedChicken

18-05-2008 17:20:48

But it's only a virtual method of base class.

gugus

18-05-2008 18:23:40

yep,but as far as i undestandResourceManagers-> in ResourceSystem::get is an instance RessourceManager and not of a herited class(i might be wrong).

betajaen

18-05-2008 19:11:10

It is an inherited class. It would be things like "FileResourceManager" or "MemoryResourceManager".


I would help more, but I have this to sort though. :?

Build log was saved at "file://N:\NxOgre\compiler\Windows\Debug\BuildLog.htm"
NxOgre - 3470 error(s), 637 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

gugus

18-05-2008 19:48:15

:shock: :shock:
I made a change that "fix"(it doesn't crash anymore for me at least,but i did not tested everything,and i don't know if it's the right way),but i changed
Mesh::Mesh(Resource* rs) {
load(rs);
}

in
Mesh::Mesh(Resource* rs) {
mMesh.zero();
load(rs);
}

betajaen

18-05-2008 20:08:32

That's some good progress there. If everyone else can try the above fix, I'll put it into NxOgre.

Down to 48 errors and 3 warnings now, much better than the 3.5k of them.

Tux11

18-05-2008 21:45:15

hey guys, I'm newish around these parts but i did test out gugus' fix, and no go. I did a little debugging of my own and while it is mMesh that is not initialized that particular one is referring to a MeshData pointer. This is where I put something in:


Convex::Convex(const Resources::ResourceIdentifier& identifier, const ShapeParams& params)
: Shape()
{
mParams = params;
paramsToDescription(&mShapeDescription, &mParams);
mResourceIdentifier = identifier;
mMesh = NULL; //<==== initialize this pointer
// meshname = ResourceSystem->removeResourcePrefix()
// mResourceSystem->hasMesh(meshname) - Identifier will filter out xxx:// bits.
// -no
// -> resource = getResource(identifier)
// -> mesh = resource->getAsMesh()
// -yes
// -> mesh = ResourceSystem::getMesh()

}


I think the reason you might not have been seeing it is that through some obscure setting somewhere all the memory gets set to 0xcdcdcdcd for this exact reason. It might be disabled on some peoples systems so mMesh would be 0 and it would load the mesh alright.

So side note: has anyone every had any major problems with fopen, fseek, and fclose? I'm getting alot of strange asserts, I thought it was just something I did in .9 but then I upgraded to bleeding and I'm still seeing it so I'm pretty sure its my computer. Anyone have any words of advice?

betajaen

18-05-2008 22:38:16

So side note: has anyone every had any major problems with fopen, fseek, and fclose? I'm getting alot of strange asserts, I thought it was just something I did in .9 but then I upgraded to bleeding and I'm still seeing it so I'm pretty sure its my computer. Anyone have any words of advice?

It could be. I haven't heard anything like in or outside NxOgre on the forums. What's your setup?

Tux11

19-05-2008 01:49:50

ogre 1.4.7
latest from svn for nxogre
and I'm not sure what physx I'm using because i just upgraded but I'm pretty sure its still 2.7.3.

I have been using ogremax for mesh exports and scythe for physics rigging and a really simple loader which uses filestreams and works fine.

What are the directory restrictions for the new resource system, I have a convex mesh in the same directory as the mesh model and have been unable to load it. Thanks for all the help and great work with nxogre.

betajaen

19-05-2008 11:30:04

You have to specify the directory name that the convex mesh is in.

Tux11

19-05-2008 14:16:20

is it tied into the resource.cfg file used for the ogre resource system or does it have to be a root of where the program is executing.

betajaen

19-05-2008 14:19:10

Where the application is. NxOgre doesn't touch the Ogre Resource system.

gugus

19-05-2008 14:36:31

well,I am almost sure my fixe is necessary,beacause he check if mMesh.iszero() and if not he doesn't load the mesh. And when the mesh is created,there is nowhere where it put the mMesh.zero(),so if I understand well,it will never load the mesh.
Note that it won't crash if you only load the mesh in the ressourcesysteme,but if you try to create a shape with it,it will crash.

Tux11

19-05-2008 17:07:08

I think that is where the confusion is. There are actually two variables named mMesh. One is a MeshData member and the other is Mesh*. Both changes are most likely necessary but i believe that it checks the Mesh* when choosing if it should load the mesh or not.

FriedChicken

20-05-2008 07:36:40

i've added "mMesh.zero()". When debuging after the two line:

Resources::ResourceSystem::getSingleton()->addMesh("file://cube.1m.nxs");
Resources::Mesh* mesh = Resources::ResourceSystem::getSingleton()->getMesh("cube.1m.nxs");

I still got uninitialized mesh:

- mesh 0x0cc90c60 {mMesh={...} } NxOgre::Resources::Mesh *
- mMesh {mTriangleMesh=0x00000000 mConvexMesh=0x00000000 mSkeletonMesh=0x00000000 ...} NxOgre::Resources::Mesh::MeshData
+ mTriangleMesh 0x00000000 NxTriangleMesh *
+ mConvexMesh 0x00000000 NxConvexMesh *
+ mSkeletonMesh 0x00000000 NxCCDSkeleton *
+ mClothMesh 0x00000000 NxClothMesh *
+ mSoftBodyMesh 0x00000000 NxSoftBodyMesh *
mType MT_Unknown NxOgre::Resources::MeshType
mNbReferences 1 unsigned int
mTextureCoordinates 0xcdcdcdcd Betajaen::SharedList<Betajaen::Vector3<float>,Betajaen::SharedAllocator> *
+ mMaterialAlias 0xcdcdcdcd {mMaterials={...} } NxOgre::Resources::MaterialAlias *

FriedChicken

20-05-2008 09:38:25

haha~~ Guess What? I've found the root cause of this annoying bug!
Now here is my fix.
At the bottom of the method in NxOgreMesh.cpp :

void Mesh::MeshData::zero() {
mTriangleMesh = 0;
mConvexMesh = 0;
mSkeletonMesh = 0;
mClothMesh = 0;
mSoftBodyMesh = 0;
mType = MT_Unknown;
mNbReferences = 0;
}

Append this line:

mMaterialAlias = 0;


Because isZero() method checks the variable mMaterialAlias whether it's initialized.


bool Mesh::MeshData::isZero() const {
return (mTriangleMesh == 0 && mConvexMesh == 0 && mSkeletonMesh == 0 && mClothMesh == 0 && mSoftBodyMesh == 0 && mMaterialAlias == 0);
}


Besides, it's necessary to add mMesh.zero() before loading in the constructor:

Mesh::Mesh(const ResourceIdentifier& ri) {
mMesh.zero();
load(ri);
}

/////////////////////////////////////////////////////////////

Mesh::Mesh(Resource* rs) {
mMesh.zero();
load(rs);
}


So that I can use converted files from Flour now. Cheers!

betajaen

20-05-2008 10:35:22

Huzzah!

gugus

20-05-2008 10:38:27

:D :D Yep,you need to apply the patch posted here(http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=6891) by Caphalor in order to make my patch work(i already applied it and supposed that poeple around here did the same but it seems that i was wrong).

betajaen

28-05-2008 23:02:47

Huge Success





I applied Caphalor's and gugus' fixes, and it seems Convex meshes are working again. I had problems myself with the Release version of Cake crashing when using a Convex mesh, but worked with Debug.

Both of those images show Convex meshes used in Actors. The barrel is a convex shape, the concrete barrier is a compound of two convex meshes, and the concrete weight is a compound of three cubes. The convex meshes were converted using Flour 0.2 (not yet released), multiple times (during testing), and both work as expected in Debug and Release versions of Cake.

I haven't tried Triangle meshes yet, but the bug may be squashed.

toglia

02-06-2008 07:03:32

Cool, I will try the solution myself. Will the svn be updated with this fix?

EDIT: I downloaded the latest Bleeding (1.21), did all the changes, compiled it, updated the environment variable, replaced the dlls of my project, but still getting the crash on:

nxogreshapemeshes.cpp
mShapeDescription.meshData = mMesh->mMesh.mConvexMesh;

First I tried to load some convex shapes that NxOgre 0.9 had baked for me before. Then I used some flour ones, same crash, I get nothing written in the NxOgre log either...

Changes I did:
1)
Mesh::Mesh(const ResourceIdentifier& ri) {
mMesh.zero();
load(ri);
}



2)
Mesh::Mesh(Resource* rs) {
mMesh.zero();
load(rs);
}


3)
void Mesh::MeshData::zero() {
mTriangleMesh = 0;
mConvexMesh = 0;
mSkeletonMesh = 0;
mClothMesh = 0;
mSoftBodyMesh = 0;
mType = MT_Unknown;
mNbReferences = 0;
mMaterialAlias = 0;
}



am I missing something?

Caphalor

02-06-2008 14:54:12

Please post some code of your app, maybe you didn't add the nxs file to NxOgre's resource system or something like that.
This is how it works for me:

NxOgre::Resources::ResourceSystem::getSingleton()->addMesh("file://Data/Media/Meshes/Level/Fischerdorf.mesh.nxs");
new NxOgre::TriangleMesh(NxOgre::Resources::ResourceSystem::getSingleton()->getMesh("Data/Media/Meshes/Level/Fischerdorf.mesh.nxs"), my_shapeparams);

By the way, it would be nice if that worked, too (just as it does in Ogre's resource system):

new NxOgre::TriangleMesh(NxOgre::Resources::ResourceSystem::getSingleton()->getMesh("Fischerdorf.mesh.nxs"), my_shapeparams);


Edit: Ok I just read that you want a convex shape, I didn't try that yet but it should work with the same principle.

Sorry for my english...

toglia

02-06-2008 15:20:31

Oh, I see. Thats maybe it.

On 0.9 I just had to put my nxs files besides the exe to get it working. Now I can put on a folder :P ! Do I have to do this with all my shapes? They're like a couple hundreds...

Thanks Caphalor.

toglia

05-06-2008 04:16:29

If I do this:
NxOgre::Resources::ResourceSystem::getSingleton()->addMeshAs("file://convex1.nxs","conv1");

CompoundShape * compoundSphere = new CompoundShape();
compoundSphere->add(new Convex("conv1"));

I still get a crash.

Code supplied by Caphalor is the only way I got it working:

NxOgre::Resources::ResourceSystem::getSingleton()->addMesh("file://convex1.nxs");
CompoundShape * compoundSphere = new CompoundShape();
compoundSphere->add(new Convex(NxOgre::Resources::ResourceSystem::getSingleton()->getMesh("convex1.nxs")));

cecchisandrone

31-07-2008 14:27:26

Hi all,
I'm new to NxOgre and I've tested successfully elementary shapes (cubes and spheres). Now I want to use my own meshes, created with 3DS. I've exported them in .mesh and converted successfully with Flour. When I try to use them in Ogre with this code:

World* mWorld = new World("use-log: yes, time-controller: ogre");
Scene* mScene = mWorld->createScene("Eddie", "gravity: yes, floor: yes, renderer: ogre");
NxOgre::Resources::ResourceSystem::getSingleton()->addMesh("file://tilted_plane.nxs");
mScene->createBody("tilted_plane.nxs",new TriangleMesh(NxOgre::Resources::ResourceSystem::getSingleton()->getMesh("tilted_plane.nxs")),Vector3(0,0,0),"static:yes");

I receive this exception:

I put the tilted_plane.nxs in the same folder as the executable.
Thanks for help.

betajaen

31-07-2008 14:40:21

You have to use tilted_plane.mesh with Ogre and titled_plane.nxs with NxOgre.

In your case, it's:

World* mWorld = new World("use-log: yes, time-controller: ogre");
Scene* mScene = mWorld->createScene("Eddie", "gravity: yes, floor: yes, renderer: ogre");
NxOgre::Resources::ResourceSystem::getSingleton()->addMesh("file://tilted_plane.nxs");
mScene->createBody("tilted_plane.mesh",new TriangleMesh(NxOgre::Resources::ResourceSystem::getSingleton()->getMesh("tilted_plane.nxs")),Vector3(0,0,0),"static:yes");

cecchisandrone

31-07-2008 14:46:23

Ohhh...yes! Thanks :)

Rhys

26-09-2008 23:43:17

Mh...just a little question to the second constructor of both ConvexMesh and TriangleMesh...
In both cases, the mMesh member remains untouched in his initial non-initialized state...but that collides with the createShape method with its simple question "if (mMesh == 0)"

Don't know if this was mentioned before...didn't found anything...so don't blame me if it was (don't mistake if for the mMesh.zero() issue, this was within the Mesh class).

whw

25-10-2008 03:58:44

this is my code


NxOgre::Resources::ResourceSystem::getSingleton()->addMeshAs("file://../../media/models/terrain.mesh", "villeCollision");
NxOgre::Resources::Mesh* collisionMesh = NxOgre::Resources::ResourceSystem::getSingleton()->getMesh("villeCollision");
NxOgre::Actor* collisionActor = mPhysiX->mNxScene->createActor ( "Collision Mesh", new NxOgre::TriangleMesh(collisionMesh), Vector3(0, 0, 0), "static: yes");


I use .mesh model