unclepauly
31-08-2008 18:46:20
ive just downloaded the latest NxOgre, and this is my first time of using it.
i have used flour (just downloaded the one from the web site) to convert box.mesh (the 2k one that comes with Ogre) into box.nxs, and now all i want to do is call createBody on it. heres my code:
the app crashes at createBody with an access violation.
the debugger shows that after i new the Convex with getMesh("mybox"):
- convex is a valid pointer
- convex->mMesh is also a valid pointer, but every member of mMesh (mTriangleMesh, mConvexMesh) is uninitialised (0xcdcdcdcd).
- convex->mShapeDescription.type is NX_SHAPE_CONVEX, but
- convex->mShapeDescription.meshData is NULL
is any of the above the reason for the crash, and if so what am i doing wrong ?
i have used flour (just downloaded the one from the web site) to convert box.mesh (the 2k one that comes with Ogre) into box.nxs, and now all i want to do is call createBody on it. heres my code:
NxOgre::Resources::ResourceSystem::getSingleton()->addMeshAs("file://D:\\GAME_STUFF\\FYP\\theGame\\media\\models\\box.nxs", "mybox");
NxOgre::Convex* convex = new NxOgre::Convex(NxOgre::Resources::ResourceSystem::getSingleton()->getMesh("mybox"));
NxOgre::CompoundShape* shape = new NxOgre::CompoundShape();
shape->add(convex);
NxOgre::Body* myboxbody= mNxScene->createBody("my_box_body", shape, Ogre::Vector3(360, 50, 360), "model: box.mesh", "mass: 10");
the app crashes at createBody with an access violation.
the debugger shows that after i new the Convex with getMesh("mybox"):
- convex is a valid pointer
- convex->mMesh is also a valid pointer, but every member of mMesh (mTriangleMesh, mConvexMesh) is uninitialised (0xcdcdcdcd).
- convex->mShapeDescription.type is NX_SHAPE_CONVEX, but
- convex->mShapeDescription.meshData is NULL
is any of the above the reason for the crash, and if so what am i doing wrong ?