/////////////////////////////////////////////////////////////////////////// // // Realistic rain real-time simulation program // // Pierre Rousseau // /////////////////////////////////////////////////////////////////////////// // // Main camera, and external events (mouse/keyboard) handling // /////////////////////////////////////////////////////////////////////////// #ifndef __RAIN_FRAME_LISTENER__ #define __RAIN_FRAME_LISTENER__ #include "CommonRain.h" #include "RainCloseDropsParticles.h" #include /** RainFrameListener class * processes keyboard and mouse events, * and performs all computations needed for each frame */ class RainFrameListener : public ExampleFrameListener { private: SceneNode *mViewNode, *mCameraNode; Real timer; CloseDropsParticles *mRainSystem; public: /** ** standard constructor ** - the renderWindow and camera are needed for reglar initialization of the frame listener ** - view node will only be translated (position of the observer and particle system) ** - cameranode, which must be attached to viewNode, will be rotated to look in any direction ** - syst is the particle system itself, which will need to be updated with user input, time since last frame... */ RainFrameListener(RenderWindow* win, Camera* cam, SceneNode* ViewNode, SceneNode* CameraNode, CloseDropsParticles *syst); /** ** this function is called just before a frame gets rendered ** Contains reactions to user input (keyboard, mouse), and calls for particle system update */ bool frameStarted(const FrameEvent& evt); /** ** this function is called just after a frame gets rendered */ bool frameEnded(const FrameEvent& evt); protected: /** ** function to update the text of the overlay with fps stats */ void updateStats(void); /** ** function to set a specific text on the stats overlay */ void displayMessage(String text); }; #endif //__RAIN_FRAME_LISTENER__