[BloodyMess 1.5.4] World Creation Problem [Solved]

marceloharmonia

02-07-2009 17:37:09

Hi, I was using NxOgre 1.0 and so downloaded the BloodyMess 1.5.4 because I was having problems with 1.0 version :x. Well, I compiled the source of NxOgre and of NxOgreOGRE3D too. I read a BloodyMess tutorial of Ogre Wiki: http://www.ogre3d.org/wiki/index.php/Bl ... Tutorial_7, but when I was running the aplication ocurred a error on line 46 that is:
mWorld = NxOgre::World::createWorld();
The error mensage is: Unhandled exception at 0x001e2710 in NxOgreDemo.exe: 0xC0000005: Access violation reading location 0x00000000.
And the Autos Window inform this null pointer: +this 0x00000000 {mWorld=??? mScene=??? mTimeController=??? ...} BloodyMessTutorial7 * const.

Who can help me? I didn't modify nothing on tutorial source. :(

Thank you, and sorry for the inconvenience.

betajaen

02-07-2009 18:17:24

The cause of that sort of error seems to be the PhysX SDK not starting properly. Are there any error messages printed to the windows console, or can you get a more specific line of where it's crashing?

marceloharmonia

02-07-2009 22:15:03

The cause of that sort of error seems to be the PhysX SDK not starting properly
Is it possible that PhysX SDK not starting because of it version? The version of my SDK is 2.8.1.
Are there any error messages printed to the windows console, or can you get a more specific line of where it's crashing?
Well, my app don't have a console, this is my application source:

#include "ExampleApplication.h"
#include <NxOgre.h>
#include <NxOgreOGRE3D.h>

class BloodyMessTutorial7Listener : public ExampleFrameListener
{
public:
BloodyMessTutorial7Listener(RenderWindow *win, Camera *cam)
: ExampleFrameListener(win, cam)
{
mTimeController = NxOgre::TimeController::getSingleton();
}

bool frameStarted(const FrameEvent& evt)
{
mTimeController->advance(evt.timeSinceLastFrame);
return ExampleFrameListener::frameStarted(evt);
}

protected:
NxOgre::TimeController* mTimeController;
};

class BloodyMessTutorial7 : public ExampleApplication
{
protected:
NxOgre::World* mWorld;
NxOgre::Scene* mScene;
NxOgre::TimeController* mTimeController;
OGRE3DRenderSystem* mRenderSystem;

void createScene()
{
// Set ambient light
mSceneMgr->setAmbientLight(ColourValue(0.5f, 0.5f, 0.5f));

// Create a light
Light* l = mSceneMgr->createLight("MainLight");
l->setPosition(20, 80, 50);

// Position the camera
mCamera->setPosition(0, 20, 80);
mCamera->lookAt(0, 20, 0);

// Create the world
mWorld = NxOgre::World::createWorld();

// Create scene description
NxOgre::SceneDescription sceneDesc;
sceneDesc.mGravity = NxOgre::Real3(0, -9.8f, 0);
sceneDesc.mName = "DemoScene";

// Create scene
mScene = mWorld->createScene(sceneDesc);

// Set some physical scene values
mScene->getMaterial(0)->setStaticFriction(0.5);
mScene->getMaterial(0)->setDynamicFriction(0.5);
mScene->getMaterial(0)->setRestitution(0.1);

// Create render system
mRenderSystem = new OGRE3DRenderSystem(mScene);

//Create time controller
mTimeController = NxOgre::TimeController::getSingleton();

// Create floor plane (BloodyMess)
mScene->createSceneGeometry(new NxOgre::PlaneGeometry(0, NxOgre::Real3(0, 1, 0)), NxOgre::Matrix44(NxOgre::Matrix44::IDENTITY));

// Create floor plane (Ogre)
MovablePlane *plane = new MovablePlane("Plane");
plane->d = 0;
plane->normal = Vector3::UNIT_Y;
Ogre::MeshManager::getSingleton().createPlane("PlaneMesh",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
*plane, 120, 120, 1, 1, true, 1, 3, 3, Vector3::UNIT_Z);
Entity *planeEnt = mSceneMgr->createEntity("PlaneEntity", "PlaneMesh");
planeEnt->setMaterialName("PlaneMat");

Ogre::SceneNode* mPlaneNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
mPlaneNode->attachObject(planeEnt);

// Open archive and load the meshes
NxOgre::ResourceSystem::getSingleton()->openArchive("media", "file:media");
NxOgre::Mesh* convexMesh = NxOgre::MeshManager::getSingleton()->load("media:Barrel.nxs");
NxOgre::Mesh* triangleMesh = NxOgre::MeshManager::getSingleton()->load("media:Stairs.nxs");

// Create the Convex and the TriangleGeometry
NxOgre::Convex* convex = new NxOgre::Convex(convexMesh);
NxOgre::TriangleGeometry* triangleGeometry = new NxOgre::TriangleGeometry(triangleMesh);

// Create the OGRE3DBody with the Convex as its shape
OGRE3DBody* convexBody = mRenderSystem->createBody(convex, NxOgre::Real3(0, 30, 0), "Barrel.mesh");
convexBody->setGlobalOrientation(NxOgre::Matrix33(NxOgre::Real4(0, 45, 0, 45)));

// Create the SceneGeometry
mScene->createSceneGeometry(triangleGeometry, NxOgre::Matrix44(NxOgre::Real3(0, 5, 0)));

// Create the Entity and Scenenode to visualize the SceneGeometry
Ogre::Entity* triangleEntity = mSceneMgr->createEntity("triangleEntity", "Stairs.mesh");
Ogre::SceneNode* triangleNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
triangleNode->attachObject(triangleEntity);
triangleNode->setPosition(Vector3(0, 5, 0));
}

// Create a new frame listener
void createFrameListener()
{
mFrameListener = new BloodyMessTutorial7Listener(mWindow, mCamera);
mRoot->addFrameListener(mFrameListener);
}
};

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
#endif

#ifdef __cplusplus
extern "C" {
#endif

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
#else
int main(int argc, char **argv)
#endif
{
// Create application object
BloodyMessTutorial7 app;

try {
app.go();
} catch(Exception& e) {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
MessageBoxA(NULL, e.getFullDescription().c_str(),
"An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
std::cerr << "An exception has occurred: " << e.getFullDescription();
#endif
}

return 0;
}

#ifdef __cplusplus
}
#endif


And a Print Screen of the aplication error:


I will try re-install PhysX SDK.

Thank you!

spacegaier

02-07-2009 22:20:43

PhysX version 2.8.1 is fine.

Console version: Just go to the project settings: Linker → System → SubSystem → change it to Console.

marceloharmonia

02-07-2009 22:39:16

The console don't return error messages.....

spacegaier

02-07-2009 22:51:08

Are you sure that you are using the right DLLs (and not the old ones from NxOgre 1.0)? In doubt recopy the new ones (from the BloodyMess sdk folder) to your working directory.

marceloharmonia

02-07-2009 22:58:10

Yes, I'm using the dlls of BloodyMees. Oh and after that I re-installed the PhysX SDK the problem continue...

spacegaier

02-07-2009 23:17:58

I assume that your also linking against the right LIBs and inserted the right include directories in the IDE settings (otherwise there would probably be compile errors). And building BloodyMess worked without any error (except the Postbuildtool stuff)?

Mhhh..really strange :?

Did you just take over the existing NxOgre 1.0 project and just altered the code? If yes, there could be some wrong project settings, so setting up a new project could help (the only thing you have to setup, is entering the linking dependencies).

Honestly, I'm running out of ideas right now :( ...

PS: Running the PhysX SDK samples works?

marceloharmonia

02-07-2009 23:25:55

I assume that your also linking against the right LIBs and inserted the right include directories in the IDE settings (otherwise there would probably be compile errors). And building BloodyMess worked without any error (except the Postbuildtool stuff)?
It's code is a source of http://www.ogre3d.org/wiki/index.php/Bl ... Tutorial_7, the dlls and configuration are ok.

Did you just take over the existing NxOgre 1.0 project and just altered the code? If yes, there could be some wrong project settings, so setting up a new project could help (the only thing you have to setup, is entering the linking dependencies).
No, I didn't.

Running the PhysX SDK samples works? Honestly, I didn't try run the PhysX SDK.

marceloharmonia

03-07-2009 00:17:51

Hi, I tried run the PhysX Samples, but when I execute the app the console open and when will open the window the Windowns show a error message and the app close.

spacegaier

03-07-2009 08:22:32

Well, this error message could be of intereset ;)

betajaen

03-07-2009 09:01:43

If the PhysX samples crash; then your SDK and/or PhysX runtime isn't installed properly.

spacegaier

03-07-2009 09:02:51

You did also install the PhysX SystemSoftware, did you? The SDK alone won't work!

marceloharmonia

03-07-2009 14:49:33

You did also install the PhysX SystemSoftware, did you? The SDK alone won't work!
Oh, I didn't install the PhysX SystemSoftware... I will try install it.

spacegaier

03-07-2009 15:49:40

You should deinstall the SDK before that, as it states on the NVIDIA PhysX page:

NOTE: Before installing the SDK, you must install the latest PhysX System Software.

marceloharmonia

03-07-2009 18:48:10

Oh, After that I installed the PhysX System Software, the PhysX Demos are running ok and my aplication too.
Thank you for all. :D