This is all my code to initialize the camera.
Code: Select all
// In the header (.h) file
IrrlichtDevice* irrDevice;
IVideoDriver* irrVideoDriver;
ISceneManager* irrSceneMgr;
IGUIEnvironment* irrGUIEnv;
ICameraSceneNode* irrCamera;
Code: Select all
// In the (.cpp) file
irrDevice = createDevice(EDT_OPENGL, dimension2d<s32>(1024, 768), 16, false, true, this);
irrVideoDriver = irrDevice->getVideoDriver();
irrSceneMgr = irrDevice->getSceneManager();
irrGUIEnv = irrDevice->getGUIEnvironment();
// add a FPS camera with rotate and move speed set to 0.0f
irrCamera = irrSceneMgr->addCameraSceneNodeFPS(0, 0.0f, 0.0f);
irrCamera->setPosition(vector3df(0, 50, 0));
irrCamera->setInputReceiverEnabled(false);
Thats all really, although I have other code that indirectly modifies the camera.
Code: Select all
irrCamera = irrDevice->getSceneManager()->getActiveCamera();
NewtonBodySetUserData(nBody, irrCamera);
Then I try and move & rotate the camera through Newton callbacks ect.
At the moment I am not doing much with newton callbacks so I don't think it should make much difference.