I am using the first event receiver from here http://irrlicht.sourceforge.net/phpBB2/ ... ass#28044 . I have began to write my update() function but I am unable to work out how to get the active camera. Spintz uses getObject(), but I think this must be using a custom class or IrrlichtNX or something.
I think I need to use getActiveCamera(). the device is declared in main.cpp as follows
Code: Select all
#include <Irrlicht.h>
#include "CEventReceiver.h"
using namespace irr;
#pragma comment(lib, "Irrlicht.lib")
int main()
{
// start up the engine
IrrlichtDevice *device = createDevice(video::EDT_OPENGL,
core::dimension2d<s32>(640,480), false);
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* scenemgr = device->getSceneManager();
gui::ICursorControl * cursorcontrol = device->getCursorControl();
cursorcontrol->setVisible(false);
// set initial window title shown whilst loading
device->setWindowCaption(L"Cameleon Engine");
// add .pk3 archive to the file system
device->getFileSystem()->addZipFileArchive("maps/map-20kdm2.pk3");
// load .bsp file and show it using an octtree
scenemgr->addOctTreeSceneNode(scenemgr->getMesh("20kdm2.bsp"));
// add a first person shooter style user controlled camera
scenemgr->addCameraSceneNodeFPS();
//create Event Receiver
CEventReceiver eReceiver;
wchar_t tmp[255];
// draw everything
while(device->run() && driver)
{
eReceiver.Update();
driver->beginScene(true, true, video::SColor(255,0,0,255));
scenemgr->drawAll();
driver->endScene();
// get driver name and fps to display in window title
swprintf(tmp, 255, L"Cameleon Engine (%s fps:%d)", driver->getName(), driver->getFPS());
device->setWindowCaption(tmp);
}
// delete device
device->drop();
return 0;
}