OGRE3dBody* convexMesh crash

klarax

28-09-2009 15:13:19

Betajaen I hope your there mate, I got a stupid crash and cant fix it...

Ok, here is the code im using:

NxOgre::ResourceSystem::getSingleton()->openArchive("media", "file:C:\Users\klarax\desktop\game\media");

NxOgre::Mesh* convexMesh = NxOgre::MeshManager::getSingleton()->load("media:vase2.nxs");
NxOgre::Convex* convex = new NxOgre::Convex(convexMesh);

OGRE3DBody* convexBody = m_pRenderSystem->createBody(convex, NxOgre::Real3(0, 30, 0), "vase2.mesh");
convexBody->setGlobalOrientation(NxOgre::Matrix33(NxOgre::Real4(0, 45, 0, 45)));


And here is the line that crashes my app:

OGRE3DBody* convexBody = m_pRenderSystem->createBody(convex, NxOgre::Real3(0, 30, 0), "vase2.mesh");

I think its also best to state here that the mesh is successfully convert correctly using flour using the command:

flour convert in:vase2.mesh, into:convex, out:vase2.nxs

I should also point out the fact that mesh has 254 verts, as I read that convex should have less than 256 verts.

I dont know what the problem is and, its deffinatly that line, I have debugged it and it ends up on the following line:

[attachment=0]error.jpg[/attachment]

Thanks

Klarax

betajaen

28-09-2009 15:34:52

The mEntity == NULL line right?

I know this is going to be a stupid question; But vase2.mesh is readable by Ogre right? You have it all set up. So in theory you could create an entity/node with vase2.mesh in it at whim right?

klarax

29-09-2009 12:13:37

Hey man,

Yeah, vase2.mesh can definatly be seen when using within Ogre and not when using NXOgre.

[EDIT] Out of Curiosity; does the nxs file goes in the models folder yeah?

also, does the mesh of the same model also go inside this folder too, or remove it? (even tho i tried different combinations though i'd ask to clear this up in my mind :P )

betajaen

29-09-2009 12:38:01

If you have Ogre setup to read the media folder then your vase2.mesh goes in there, and the vase2.nxs file should also go in the media folder, as you have the archive set to the same directory.

What is the ptr of convexMesh is it NULL or 0xCCCCCCCCC ? If it's either then it's a simple path problem.

klarax

29-09-2009 13:15:12

Hey man,

since a picture can say athoughsand words....

betajaen

29-09-2009 13:42:49

Yep. Thought so;

The Convex mesh wasn't loaded; either due to the resource system not finding the mesh, or PhysX cant' read the Convex due it being bad.

Anything printed to the console? or to NxOgre.log.txt?

klarax

29-09-2009 15:52:29

hmmmm ok nice to know someone is up to speed on things :)

i dont appear to have an nxogre.log, nor any console showing....... :s

[EDIT] I created a simple ball, converted into convex type, still the same error.

So i take it its all down to the path?

betajaen

29-09-2009 16:07:26

Sounds like a good idea. I would even go to the trouble of setting the ball's name to vase2, just to make sure.

If you like I can test out vase2 in flour for you; PM the download link if you so wish.

klarax

29-09-2009 16:10:59

Sorry man, think you replied to me as i edited my post :P

yeah i created a new file called ball, and converted it, (read above) and same issue arose. sounds to me like the path thing you mentioned :S

betajaen

29-09-2009 16:30:54

Try:

"file:C://Users//klarax//desktop//game//media"

klarax

29-09-2009 16:40:09

Nah, that didn't make any difference :<

klarax

29-09-2009 16:58:14

Hey man, me again.

I'm not an expert or anything, but using the triangleEntity way of doing things so the nxs file is static within the scene works as it should. I.E. It shows up and no crash :P

So would that not mean that the paths are all correct?

betajaen

29-09-2009 17:02:24

Yep. It probably means there's a bug with NxOgre.

If you have Flour 0.4 handy you can test your convex mesh in the cupcake utility; or if you like - I can.

[Edit]

It can't be a bug with NxOgre otherwise Convex meshes in Cupcake wouldn't work. It must be your mesh.

klarax

29-09-2009 17:09:00

if it was the mesh? would it not work when converted into Triangle type? cos that works using the same mesh

?

betajaen

29-09-2009 17:22:20

Triangle meshes have less restricted conditions than convex meshes.

klarax

30-09-2009 13:33:41

Ahh right, ok

Can you check my files im using then plz? :)

http://www.filefront.com/14629299/ball.nxs/
and
http://www.filefront.com/14629303/vase2.nxs/

betajaen

30-09-2009 13:41:31

Apart from them being freaking huge they are fine, also the vase2.nxs is not very vase like - it's more like a half of a capsule

klarax

30-09-2009 13:50:37

yeah im not the best artist in the world, and am only using them as a temp mesh to test with NxOgre.

So, now that the files are fine.... what else can they issues be? any ideas ? :P

betajaen

30-09-2009 14:00:08

Must be a path issue then. One thing you could try is don't make an archive, but use the internal secret used by the NxOgre secret bits.

Just move the vase.nxs into the executable folder with your game, then do;

NxOgre::Mesh* convexMesh = NxOgre::MeshManager::getSingleton()->load("internal-cwd:vase2.nxs");

klarax

30-09-2009 14:07:18

lol, that dont work either :P

crashes on that line....

maybe im not destined to use NxOgre :P

betajaen

30-09-2009 14:12:14

Perhaps. ;)

If you want, I can have a quick look at your app to see if you did anything wrong setting NxOgre up or anything. PM me the link if your interested.

klarax

30-09-2009 15:04:50

sent mate :)