[bloodymess]problem of createBody from .nxs

snow119a

13-05-2009 14:24:35

i use this code to createBody
NxOgre_Namespace::ResourceSystem::getSingleton()->openArchive("media","file://d:/ogresdk/bin/debug");
NxOgre_Namespace::Mesh* tankMesh = NxOgre_Namespace::MeshManager::getSingleton()->load("media:T2cube.nxs");
mCubeTwo = mRenderSystem->createBody(new NxOgre_Namespace::Convex(tankMesh), NxOgre_Namespace::Real3(0, 50, 0), "T2cube.mesh");


when running , there's a clash in ogre3dbody.cpp line52 : create(prototype, rendersystem->getScene());
my version is bloodymess 1.5.4

snow119a

13-05-2009 15:12:36

please help me slove it~~thanks

betajaen

13-05-2009 15:27:48

Sounds like a null pointer if it's crashing at that line. You have a Scene, OGRE3DRenderSystem and related classes created - right? If so, can you find out more why it's exactly crashing, perhaps in the create function?

lonwolf

04-06-2009 11:12:28

i got a similar problem. I've downloaded the latest flour tool i could find (0.3.2), converted the cube.1m.mesh into cube.nxs (as convex), and replaced the myBody->create() from box to convex (just to test the loading mechanism of a convex shape - going to need loads of them in my project )


NxOgre::ResourceSystem::getSingleton()->openArchive("media","file://d:/Ogre3D/NxOgre/BloodyCake/application");
NxOgre::Mesh* m = NxOgre::MeshManager::getSingleton()->load("media:cube.nxs");
myBody = mRenderSystem->createBody(new NxOgre::Convex(m),Real3(0,40,0),"cube.1m.mesh");


It's all plain OgreCake code (latest, bloodymess) with just those 3 lines in cake.cpp

And:
1.) There's no code posted on wiki to show how exactly a convex mesh should be created.
2.) The above code crashes at the createBody function.
3.) Assuming there is a mistake around and can be corrected, is there another way of loading a .nxs file without specifying the whole path from the disk drive to the folder?

The wiki could use a tutorial for converting and loading .mesh files into Ogre and NxOgre (through nxs and convex or triangle) - because this is one of the vital problems when working with a physics engine, user created objects, non-primitives. Good job on the other tutorials Spacegaier, will come in handy for sure. I've seen there are quite a few who managed to get this working but i see no working code on the forums.

spacegaier

04-06-2009 11:35:31

1. I can't find any place in BloodyCake (1.5.4) that uses Convexes as you say. Your three lines don't work currently as there was a bug which is already fixed and will be in 1.5.5 which will be released as soon as Cloth are totally working.
2. Yes, you are using the right Flour (0.3.2). A new one is in development though.
3. Converting arcticle (Ogre <---> NxOgre) in the wiki will come.
4. Good job on the other tutorials Spacegaier, will come in handy for sure.
Thanks :) .

lonwolf

04-06-2009 11:37:59

So i'll have to wait for convex? if you do know a method to load convex meshes into nxogre please tell me :)

spacegaier

04-06-2009 11:50:10

I'm afraid, you will have to wait until 1.5.5. I can't imagine any other way. betajaen can't just post a fix here as it affects quite many files...