Problems with cooking Mesh

Jo0oker

09-09-2011 15:44:55

Hello NxOgre-Forum,

i try to use NxOgre in my GameEngine, but i have problems with cooking some meshes. I use Critter and the last NxOgre-Release.
My Application crashs in the following Line:

cMeshData->cook("file://" + Path);

In context:

std::ifstream cStream;
cStream.open(Path.c_str(), std::ios::in);

// If the file doesn't exist
if (!cStream.good())
{
std::cout << "-- Cook Mesh: " << myMeshFolder << "/" << myMeshFile << ".nxs" << std::endl;
const Ogre::MeshPtr mPtr = myTEntity->GetEntity()->getMesh();
NxOgre::MeshData* cMeshData = Critter::MeshFunctions::read(mPtr);
cMeshData->mType = NxOgre::Enums::MeshType_Triangle;
cMeshData->cook("file://" + Path);
std::cout << "-- Cooking was success full" << std::endl;
}


When i try to debug the Line, the application crashs here:

The message meens in english:

Unhandled exception at 0x75f89bc in Tehadon.Main.exe: Microsoft C++-Exception: std::bad_alloc by Memoryposition 0x00ae9d0


The scene and world seems to be created correctly:

mySceneManager = SceneManager;
//cDesc = "time-controller:ogre, log:yes";

// Init World
myNxWorld = World::createWorld();

// Use Std. Settings
NxOgre::SceneDescription cSceneDesc;
cSceneDesc.mGravity = NxOgre::Constants::MEAN_EARTH_GRAVITY;

// Init Scene
myScene = myNxWorld->createScene(cSceneDesc);

myScene->getMaterial(0)->setStaticFriction(0.5);
myScene->getMaterial(0)->setDynamicFriction(0.5);
myScene->getMaterial(0)->setRestitution(0.1);
// Create the RenderSystem
myRenderSystem = new Critter::RenderSystem(myScene, mySceneManager);


But i have no idea where i make anything wronge.

Thank You,
Jo0oker