unhandled exeption

radsun

30-10-2007 19:42:25

Compile without errors but while debugging show mi error in thease:
void PhysXDriver::_createFrameListener() {
mWorld->getRoot()->addFrameListener(this);
mFramelistener = true;
}


My code:
#include "ExampleApplication.h"
#include "NxOgre.h"
#include "Windows.h"

using namespace Ogre;
using namespace NxOgre;

World* mWorld = new World();

class MarshintoApp : public ExampleApplication
{
protected:
public:
MarshintoApp(){}
~MarshintoApp(){ }
protected:
void createScene(void)
{
Entity* ninja = mSceneMgr->createEntity("ninja","ninja.mesh");
SceneNode* ninjaNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("ninja");
SceneNode* modelNode = ninjaNode->createChildSceneNode("ninja_model");
modelNode->attachObject(ninja);
ninjaNode->setScale(0.25,0.25,0.25);

AxisAlignedBox aab = modelNode->getAttachedObject("ninja")->getBoundingBox();
Vector3 min = aab.getMinimum()*ninjaNode->getScale();
Vector3 max = aab.getMaximum()*ninjaNode->getScale();
Vector3 center = aab.getCenter()*ninjaNode->getScale();
Vector3 size(fabs(max.x-min.x),fabs(max.y-min.y),fabs(max.z-min.z));
float radius = (size.x>size.z)?size.z/2.0f:size.x/2.0f;

}
};


INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
{
MarshintoApp app;

try
{
app.go();
} catch( Exception& e ) {
MessageBox( NULL, e.getFullDescription().c_str(), "BÅ

betajaen

30-10-2007 20:06:27

Don't make mWorld a global variable like that.

kungfoomasta

30-10-2007 20:24:35

Wow, I didn't even know you could create objects in the global scope. . .

betajaen

30-10-2007 21:12:09

You can. But World would be created before anything, even before void main().

Useful in some things, hacky in others.

radsun

31-10-2007 08:11:03

Thx now it working :wink: