Okay i am trying to make the camera move when you press W but when it runs as a program it comes up with that microsoft error crap and says it needs to be closed here is a few parts of my code
Code: Select all
class MyEventReceiver : public IEventReceiver
{
public: virtual bool OnEvent(SEvent event)
{
if (event.KeyInput.Key)
{
if(event.KeyInput.Key == KEY_KEY_W)
{
camera->setPosition(core::vector3df(300,1000,-2100));
}
}
}
};
Code: Select all
scene::ICameraSceneNode* camera =
smgr->addCameraSceneNodeFPS(0, 100.0f, 300.0f, -1, 0, 0, false);
camera->setPosition(core::vector3df(300,1000,-2100));
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, camera, core::vector3df(30,50,30),
core::vector3df(0,-1,0),
core::vector3df(0,0,0));
camera->addAnimator(anim);
anim->drop();
i get that everytime i press W running my programexample.exe has encountered a problem and needs to close. we are sorry for the inconvenience.
i have tried changing the code i have tried to repostition my camera and i still get the same thing if i leave it blank i dont get any error (but nothing heppens).
does any one see anything wrong with my code? or any other way i can get the camera to rotate?
--edit--
i forgot to say of course i am using irrlicht engine and Dev C++ compiler
