Shtuka
09-08-2011 20:44:56
I'm using AdvancedOgreFramework with the following code in void GameState::createScene()
In release mode, it works like a charm, but in Debug mode, it crashes in the line
What am I doing wrong?
ColourValue background = ColourValue(16.f/255.f, 16.f/255.f, 16.f/255.f);
OgreFramework::getSingletonPtr()->m_pViewport->setBackgroundColour(background);
m_pSceneMgr->setFog(Ogre::FOG_EXP, background, 0.001, 800, 1000);
// set shadow properties
m_pSceneMgr->setShadowTechnique(SHADOWTYPE_TEXTURE_MODULATIVE);
m_pSceneMgr->setShadowColour(ColourValue(0.5, 0.5, 0.5));
m_pSceneMgr->setShadowTextureSize(1024);
m_pSceneMgr->setShadowTextureCount(1);
// create a floor mesh resource
MeshManager::getSingleton().createPlane("floor", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
Plane(Vector3::UNIT_Y, 0), 1000, 1000, 1,1 , true, 1, 1, 1, Vector3::UNIT_Z);
// create a floor entity, give it a material, and place it at the origin
Entity* floor = m_pSceneMgr->createEntity("Floor", "floor");
floor->setMaterialName("Examples/Solid");
floor->setCastShadows(false);
m_pSceneMgr->getRootSceneNode()->attachObject(floor);
// use a small amount of ambient lighting
m_pSceneMgr->setAmbientLight(ColourValue(0.3, 0.3, 0.3));
// add a bright light above the scene
Light* light = m_pSceneMgr->createLight();
light->setType(Light::LT_POINT);
light->setPosition(-10, 40, 20);
light->setSpecularColour(ColourValue::White);
m_pCamera->setPosition(10,10,10);
m_pCamera->lookAt(0,0,0);
m_pCamera->setNearClipDistance(0.02f);
m_pCamera->setFarClipDistance(1000.0f);
// Create the world.
mWorld = NxOgre::World::createWorld();
mWorld->getRemoteDebugger()->connect();
// Create the scene
NxOgre::SceneDescription scene_description;
scene_description.mGravity = NxOgre::Constants::MEAN_EARTH_GRAVITY;
//scene_description.mUseHardware = false;
mScene = mWorld->createScene(scene_description);
// Set default material properties
mDefaultMaterial = mScene->getMaterial(0);
mDefaultMaterial->setRestitution(0.1f);
mDefaultMaterial->setDynamicFriction(0.9);
mDefaultMaterial->setStaticFriction(0.5);
// Plane creation
mScene->createSceneGeometry(NxOgre::PlaneGeometryDescription());
// Create the rendersystem.
mRenderSystem = new Critter::RenderSystem(mScene, m_pSceneMgr);
// mRenderSystem->setVisualisationMode(NxOgre::Enums::VisualDebugger_ShowAll);
// Setup a BodyDescription.
Critter::BodyDescription bodyDescription;
bodyDescription.mMass = 40.0f; // Set the mass to 40kg.
// Finally create the body.
mBody = mRenderSystem->createBody(NxOgre::BoxDescription(1,1,1), NxOgre::Vec3(0,5,0), "cube.1m.mesh", bodyDescription);
In release mode, it works like a charm, but in Debug mode, it crashes in the line
mRenderSystem = new Critter::RenderSystem(mScene, m_pSceneMgr);
What am I doing wrong?