event.h

00001 
00002 
00003 
00004 class EventReceiver : public irr::IEventReceiver
00005 {
00006 public:
00007 
00008         bool EventReceiver::OnEvent(irr::SEvent event)
00009         {
00010                 static float leftAngle = 0.00f;
00011 
00012                 if (event.EventType == irr::EET_KEY_INPUT_EVENT && event.KeyInput.PressedDown)
00013                 {
00014                         switch(event.KeyInput.Key)
00015                         {
00016                                 case KEY_KEY_C:
00017                                 {
00018                                         v3 camPos(0,0,-100);
00019                                         cam->setPosition(camPos);
00020                                         v3 arrowPos(20,-20,-50);
00021                                         arrow->setPosition(arrowPos);
00022                                         return true;
00023                                 }
00024                                 case KEY_KEY_W:
00025                                 {
00026                                         v3 forward(0,0,0.1f);
00027                                         //cam->setPosition(cam->getPosition() + forward);
00028                                         player.acceleration += forward;
00029                                         return true;
00030                                 }
00031                                 case KEY_KEY_S:
00032                                 {
00033                                         v3 backward(0,0,-0.1f);
00034                                         //cam->setPosition(cam->getPosition() + backward);
00035                                         player.acceleration += backward;
00036                                         return true;
00037                                 }
00038                                 case KEY_KEY_A:
00039                                 {
00040                                         renderOfflineAnim = !renderOfflineAnim;
00041                                         return true;
00042                                 }
00043                                 case KEY_KEY_R:
00044                                 {
00045                                         gameState = STATE_GAME_START;
00046                                         return true;
00047                                 }
00048                                 case KEY_KEY_P:
00049                                 {
00050                                         paused = !paused;
00051                                         return true;
00052                                 }
00053                                 case KEY_ESCAPE:
00054                                 {
00055                                         device->closeDevice();
00056                                 }
00057 
00058                         }
00059                 }
00060                 return false;
00061         }
00062 private:
00063         
00064 };

Generated on Sun Dec 2 18:30:26 2007 for DrgonWings by  doxygen 1.5.4