neomxl
04-12-2007 20:11:34
Hello.
I am trying to work Demo1 ino my project, but it doesn't include the example header files.
It compiles, but when I press the Spacebar it doesn't fire anything. I have done some debugging and in the demo:
OgreNewtFrameListener.cpp
when debuging msnCam has a whole host of nice attributes associated with it, however, when I debug mine, my msnCam has many "unable to evaluate expression" next to attribute names. In particular the mOrientation of my msnCam variables are garbage.
I have followed back all the definitions of the SceneNodes and my code is nearly exactly the same. It seems to me like my SceneNode needs some kind of initialisation - but I don't see that anywhere in the demo or the example headers.
The Demo version has an Ogre::SceneNode* in the Application header and a SceneNode* in the FrameListener header as do I, the only time they are referenced after this are in setupScene() to set them to a new child node and then in createFrameListener (my FrameListener code is exactly the sme as the Demo's except I have an extra couple of attributes). This is what I do for my msnCam inside setupScence():
while the Demo does this, noteing that some of mCamera settings are already set in the Example header:
I don't see any difference besides a few numbers and the fact I include a "Name". Anything else code wise is identical - this is why i feel there is a line of code I am missing to 'initialise' my msnCam somehow.
I would be grateful for any support,
Thanks
neomxl
I am trying to work Demo1 ino my project, but it doesn't include the example header files.
It compiles, but when I press the Spacebar it doesn't fire anything. I have done some debugging and in the demo:
OgreNewtFrameListener.cpp
if (mKeyboard->isKeyDown(OIS::KC_SPACE))
{
if (timer <= 0.0)
{
Ogre::Vector3 dir, vec;
Ogre::Quaternion camorient = msnCam->getWorldOrientation();
vec = Ogre::Vector3(0,0,-1);
when debuging msnCam has a whole host of nice attributes associated with it, however, when I debug mine, my msnCam has many "unable to evaluate expression" next to attribute names. In particular the mOrientation of my msnCam variables are garbage.
I have followed back all the definitions of the SceneNodes and my code is nearly exactly the same. It seems to me like my SceneNode needs some kind of initialisation - but I don't see that anywhere in the demo or the example headers.
The Demo version has an Ogre::SceneNode* in the Application header and a SceneNode* in the FrameListener header as do I, the only time they are referenced after this are in setupScene() to set them to a new child node and then in createFrameListener (my FrameListener code is exactly the sme as the Demo's except I have an extra couple of attributes). This is what I do for my msnCam inside setupScence():
msnCam = mgr->getRootSceneNode()->createChildSceneNode("CameraNode");
cam = mgr->createCamera("Camera");
cam->setPosition(0,800,0);
cam->lookAt(Vector3(0,0,0));
msnCam->attachObject(cam);
msnCam->setPosition( 0.0, -10.0, 20.0);
while the Demo does this, noteing that some of mCamera settings are already set in the Example header:
msnCam = mSceneMgr->getRootSceneNode()->createChildSceneNode();
msnCam->attachObject( mCamera );
mCamera->setPosition(0.0, 0.0, 0.0);
msnCam->setPosition( 0.0, -10.0, 20.0);
I don't see any difference besides a few numbers and the fact I include a "Name". Anything else code wise is identical - this is why i feel there is a line of code I am missing to 'initialise' my msnCam somehow.
I would be grateful for any support,
Thanks
neomxl