AWHDRi
11-07-2009 09:37:52
Hi, i have a problem with a simple app i wrote. Tutorial 5 works fine for me and i
pasted the framelistener code to my project , because i need only space shooting feature without kinematics. So, my app crashes when i press space button.
Debugger show this next entry location
And there is crash log
This application loads an ogitor's single mesh scene with attached triangle-nxs static geometry.
My framelistener
Static geometry loading
Whats the problem? And why visual debugger not works on BloodyMess 1.5.5?
And sorry for my terrible english)
pasted the framelistener code to my project , because i need only space shooting feature without kinematics. So, my app crashes when i press space button.
Debugger show this next entry location
// Matrix's are faster than vectors and quaternions.
Ogre::Matrix4 m4 = toMatrix44(getGlobalPose());
And there is crash log
The thread 'Win32 Thread' (0xa10) has exited with code 0 (0x0).
Unhandled exception at 0x0039fe55 (NxOgre.dll) in dmbapp.exe: 0xC0000005: Access violation reading location 0x00000000.
First-chance exception at 0x0039fe55 (NxOgre.dll) in dmbapp.exe: 0xC0000005: Access violation reading location 0x00000000.
Unhandled exception at 0x0039fe55 (NxOgre.dll) in dmbapp.exe: 0xC0000005: Access violation reading location 0x00000000.
The program '[2260] dmbapp.exe: Native' has exited with code 0 (0x0).
This application loads an ogitor's single mesh scene with attached triangle-nxs static geometry.
My framelistener
class TerrainFrameListener : public ExampleFrameListener
{
public:
TerrainFrameListener(RenderWindow* win, Camera* cam, NxOgre::VisualDebugger* visualDebugger, Ogre::SceneNode* node)
: ExampleFrameListener(win, cam)
{
// Reduce move speed
mMoveSpeed = 50;
mTimeController = NxOgre::TimeController::getSingleton();
mVisualDebugger = visualDebugger;
mVisualDebuggerNode = node;
}
bool frameStarted(const FrameEvent& evt)
{
mTimeController->advance(evt.timeSinceLastFrame);
mVisualDebugger->draw();
mVisualDebuggerNode->needUpdate();
//Стрелять на пробел
if(mKeyboard->isKeyDown(OIS::KC_SPACE) && mTimeUntilNextToggle <= 0)
{
LogManager::getSingletonPtr()->logMessage("*** SPACE DOWN ***");
mCubeSpace = mRenderSystem->createBody(new NxOgre::Box(1, 1, 1), NxOgre::Real3(mCamera->getPosition().x,
mCamera->getPosition().y, mCamera->getPosition().z), "cube.1m.mesh");
LogManager::getSingletonPtr()->logMessage("*** CUBE OK***");
mCubeSpace->addForce(NxOgre::Real3(mCamera->getDirection().x * 10000, mCamera->getDirection().y * 10000,
mCamera->getDirection().z * 10000), NxOgre::Enums::ForceMode_Force, true);
LogManager::getSingletonPtr()->logMessage("*** FORCE OK ***");
mTimeUntilNextToggle = 0.2;
}
return ExampleFrameListener::frameStarted(evt);
}
bool frameRenderingQueued(const FrameEvent& evt)
{
if( ExampleFrameListener::frameRenderingQueued(evt) == false )
return false;
// clamp to terrain
return true;
}
protected:
NxOgre::TimeController* mTimeController;
NxOgre::VisualDebugger* mVisualDebugger;
Ogre::SceneNode* mVisualDebuggerNode;
OGRE3DRenderSystem* mRenderSystem;
OGRE3DBody* mCubeSpace;
};
Static geometry loading
//StaticNxgeom
NxOgre::ResourceSystem::getSingleton()->openArchive("content", "file:content/stage/stg1");
NxOgre::Mesh* triangleMesh = NxOgre::MeshManager::getSingleton()->load("content:Mesh02.mesh.nxs");
NxOgre::TriangleGeometry* triangleGeometry = new NxOgre::TriangleGeometry(triangleMesh);
mScene->createSceneGeometry(triangleGeometry, NxOgre::Matrix44(NxOgre::Real3(0, 0, 0)));
Whats the problem? And why visual debugger not works on BloodyMess 1.5.5?
And sorry for my terrible english)