From: <eg...@us...> - 2006-04-16 16:35:59
|
Revision: 54 Author: egore Date: 2006-04-16 09:35:29 -0700 (Sun, 16 Apr 2006) ViewCVS: http://svn.sourceforge.net/opengate/?rev=54&view=rev Log Message: ----------- split the game even further into more object oriented stuff, breaks pretty much everything Modified Paths: -------------- include/Makefile.am include/Makefile.in include/application.h include/avatar.h include/framelistener.h Added Paths: ----------- include/camera.h include/gamestate.h include/keyboard.h include/mouse.h include/movable_object.h Modified: include/Makefile.am =================================================================== --- include/Makefile.am 2006-04-14 14:29:31 UTC (rev 53) +++ include/Makefile.am 2006-04-16 16:35:29 UTC (rev 54) @@ -10,7 +10,11 @@ application.h\ framelistener.h\ constants.h\ - optimize.h\ - avatar.h + avatar.h\ + keyboard.h\ + mouse.h\ + camera.h\ + gamestate.h\ + movable_object.h EXTRA_DIST = $(opengate_include_DATA) Modified: include/Makefile.in =================================================================== --- include/Makefile.in 2006-04-14 14:29:31 UTC (rev 53) +++ include/Makefile.in 2006-04-16 16:35:29 UTC (rev 54) @@ -187,7 +187,13 @@ opengate_include_DATA = \ application.h\ framelistener.h\ - constants.h + constants.h\ + avatar.h\ + keyboard.h\ + mouse.h\ + camera.h\ + gamestate.h\ + movable_object.h EXTRA_DIST = $(opengate_include_DATA) all: all-am Modified: include/application.h =================================================================== --- include/application.h 2006-04-14 14:29:31 UTC (rev 53) +++ include/application.h 2006-04-16 16:35:29 UTC (rev 54) @@ -25,10 +25,13 @@ #ifndef _APPLICATION_H #define _APPLICATION_H -#include <Ogre.h> #include <OgreConfigFile.h> +#include <OgreRoot.h> +#include <OgreCamera.h> +#include <OgreRenderWindow.h> #include "framelistener.h" #include "avatar.h" +#include "camera.h" #ifdef __cplusplus extern "C" @@ -60,15 +63,22 @@ protected: + CEGUI::OgreCEGUIRenderer* mGUIRenderer; + CEGUI::System* mGUISystem; + CEGUI::Window* mEditorGuiSheet; + Avatar* mAvatar; - SceneNode* mAvatarNode; + Ogre::SceneNode* mAvatarNode; - Root* mRoot; - Camera* mCamera; - SceneManager* mSceneMgr; - MyListener* mFrameListener; - RenderWindow* mWindow; + Ogre::Root* mRoot; + Camera* mCamera; + Ogre::SceneManager* mSceneMgr; + OpengateListener* mFrameListener; + Ogre::RenderWindow* mWindow; + + Ogre::SceneManager* mGuiSceneMgr; + /** Sets up the application - returns false if the user chooses to abandon configuration. */ bool setup(void); @@ -86,14 +96,6 @@ */ void createCamera(); - /*! \brief Creates a viewport with the given cameras for the scene - * - * This method creates the viewport to the scene. This is what the user will - * actually see when playing the game. The viewport uses the given cameras - * to get its picture. - */ - virtual void createViewports(void); - /*! \brief Define what is in the scene * * This method created an initial scene. So here some common things will be @@ -120,6 +122,9 @@ /// Must at least do ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); virtual void loadResources(void); + void setupEventHandlers(void); + + bool handleQuit(const CEGUI::EventArgs& e); }; #ifdef __cplusplus Modified: include/avatar.h =================================================================== --- include/avatar.h 2006-04-14 14:29:31 UTC (rev 53) +++ include/avatar.h 2006-04-16 16:35:29 UTC (rev 54) @@ -26,23 +26,24 @@ #define _AVATAR_H #include <OgreSceneNode.h> +#include "movable_object.h" #ifdef __cplusplus extern "C" { #endif -using namespace Ogre; - -class Avatar { +class Avatar : public MovableObject { public: /*! \brief Creates the avatar (not the graphical representation, the real - * one + * one) */ - Avatar(SceneNode* node); + Avatar(Ogre::SceneNode* node); + /*! \brief Destroys the avatar */ ~Avatar(); + /*! \brief Moves the avatar * * \param direction The direction the avatar is moving (i.e. Avatar::LEFT) @@ -51,39 +52,29 @@ * * This method moves the avatar in a given direction with a given scale */ - bool move(const int direction, float scale); + virtual bool move(const int direction, float scale); - /*! Direction: left */ - static const int LEFT = 1; - /*! Direction: left */ - static const int RIGHT = 2; - /*! Direction: left */ - static const int FRONT = 3; - /*! Direction: left */ - static const int BACK = 4; - /*! Direction: left */ - static const int UP = 5; - /*! Direction: left */ - static const int DOWN = 6; - - static const int YAW_LEFT = 7; - static const int YAW_RIGHT = 8; - static const int ROLL_LEFT = 9; - static const int ROLL_RIGHT = 10; - static const int PITCH_UP = 11; - static const int PITCH_DOWN = 12; - -private: - /*! Handle to the node the avatar is attached to + /*! \brief Rotates the avatar + * + * This method rotates the avatar in a given direction with a given scale + * + * \param direction The direction the avatar is rotating (i.e. + * Avatar::YAW_LEFT) + * \param scale The degree the avatar is direction (based on the time + * elapsed since the last frame) */ - SceneNode* mNode; + virtual bool rotate(int direction, Ogre::Degree scale); - /*! Value that the players avatar can pitch */ - Radian pitch; - /*! Value that the players avatar can yaw */ - Radian yaw; - /*! Value that the players avatar can roll */ - Radian roll; + virtual void performMove() {}; +private: + /*! Handle to the node the avatar is attached to */ + Ogre::SceneNode* mNode; + /*! Value that the players avatar can pitch in one frame */ + Ogre::Radian pitch; + /*! Value that the players avatar can yaw in one frame */ + Ogre::Radian yaw; + /*! Value that the players avatar can roll in one frame */ + Ogre::Radian roll; }; #ifdef __cplusplus Added: include/camera.h =================================================================== --- include/camera.h (rev 0) +++ include/camera.h 2006-04-16 16:35:29 UTC (rev 54) @@ -0,0 +1,103 @@ +/*************************************************************************** + * camera.h + * + * Sat Apr 15 17:51:35 2006 + * Copyright 2006 User + * Email + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _CAMERA_H +#define _CAMERA_H + +#include <OgreMath.h> +#include <OgreSceneManager.h> +#include <OgreCamera.h> +#include <OgreVector3.h> +#include <OgreRenderWindow.h> +#include "movable_object.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +class Camera : public MovableObject { +public: + Camera(Ogre::SceneManager* sceneManager, Ogre::RenderWindow* window, Ogre::SceneNode* avatarNode, bool moveEndOfFrame); + + /*! \brief Moves the avatar + * + * \param direction The direction the avatar is moving (i.e. Avatar::LEFT) + * \param scale The distance the avatar is moving (based on the time elapsed + * since the last frame + * + * This method moves the avatar in a given direction with a given scale + */ + virtual bool move(const int direction, float scale); + + /*! \brief Rotates the avatar + * + * This method rotates the avatar in a given direction with a given scale + * + * \param direction The direction the avatar is rotating (i.e. + * Avatar::YAW_LEFT) + * \param scale The degree the avatar is direction (based on the time + * elapsed since the last frame) + */ + virtual bool rotate(int direction, Ogre::Degree scale); + + virtual void performMove(); + +private: + /*! Handle to the players camera so we can move it on mouse or keyboard + * input + */ + Ogre::Camera* mCamera; + + /*! Value to rotate the camera by X (=yaw) + */ + Ogre::Radian mRotX; + + /*! Value to rotate the camera by Y (=pitch) + */ + Ogre::Radian mRotY; + + /*! \brief Creates a camera for the scene + * + * This method creates the necessary cameras for the game. Since we have a + * first person camera and a third person camera, we will use 2 cameras to + * do that. It would be possible to do that with one camera, but the concept + * in OGRE3D is to use 2 cameras. + */ + void createCamera(Ogre::SceneManager* sceneManager, Ogre::SceneNode* avatarNode); + + /*! \brief Creates a viewport with the given cameras for the scene + * + * This method creates the viewport to the scene. This is what the user will + * actually see when playing the game. The viewport uses the given cameras + * to get its picture. + */ + void createViewports(Ogre::RenderWindow* window); +}; + +#ifdef __cplusplus +} +#endif + +#endif /* _CAMERA_H */ Property changes on: include/camera.h ___________________________________________________________________ Name: svn:mime-type + text/x-c++hdr Name: svn:eol-style + native Modified: include/framelistener.h =================================================================== --- include/framelistener.h 2006-04-14 14:29:31 UTC (rev 53) +++ include/framelistener.h 2006-04-16 16:35:29 UTC (rev 54) @@ -25,22 +25,41 @@ #ifndef _FRAMELISTENER_H #define _FRAMELISTENER_H -#include <Ogre.h> +//Work around for memory manager problems between CEGUI and Ogre +#include <OgreNoMemoryMacros.h> +#include <CEGUI/CEGUIImageset.h> +#include <CEGUI/CEGUISystem.h> +#include <CEGUI/CEGUILogger.h> +#include <CEGUI/CEGUISchemeManager.h> +#include <CEGUI/CEGUIWindowManager.h> +#include <CEGUI/CEGUIWindow.h> +#include <OgreCEGUIRenderer.h> +#include <OgreCEGUIResourceProvider.h> +//regular mem handler +#include <OgreMemoryMacros.h> +//End of workaround +#include <OgreFrameListener.h> +#include <OgreEventProcessor.h> +#include <OgrePlatformManager.h> +#include <OgreCamera.h> +#include <OgreInput.h> +#include <OgreOverlayManager.h> #include <OgreKeyEvent.h> #include <OgreEventListeners.h> #include <OgreStringConverter.h> #include <OgreException.h> #include "avatar.h" +#include "keyboard.h" +#include "camera.h" +#include "mouse.h" #ifdef __cplusplus extern "C" { #endif -using namespace Ogre; - // Declare a subclass of the ExampleFrameListener class -class MyListener : public FrameListener, public KeyListener { +class OpengateListener : public Ogre::FrameListener { public: /*! \brief The constructor that creates the object that reacts to user input @@ -54,15 +73,14 @@ * \param useBufferedInputMouse Flag to set if the mouse input should be * buffered or not */ - MyListener(RenderWindow* win, Camera* cam, Avatar* avatar, - bool useBufferedInputKeys, bool useBufferedInputMouse); + OpengateListener(Ogre::RenderWindow* win, Camera* cam, Avatar* avatar, CEGUI::Renderer* renderer); /*! \brief The destructor to free the input readers * * It will destroy either the reader for buffered or unbuffered input, * depending on what was chosen in the constructor */ - ~MyListener(); + ~OpengateListener(); /*! \brief This method processes the keyboard events * @@ -72,7 +90,7 @@ * * \param evt The frame event from frameStarted() */ - bool processUnbufferedKeyInput(const FrameEvent& evt); + bool processUnbufferedKeyInput(const Ogre::FrameEvent& evt); /*! \brief This method processes the mouse events * @@ -82,15 +100,8 @@ * * \param evt The frame event from frameStarted() */ - bool processUnbufferedMouseInput(const FrameEvent& evt); + bool processUnbufferedMouseInput(const Ogre::FrameEvent& evt); - /*! \brief Make all the camera movement - * - * This method is called after the unbuffered input events are processed - * and have modified the translation vector, yaw and pitch - */ - void moveCamera(); - /*! \brief Enable or disbale the debug overlay * * This method changes the visibility status of the debug overlay which was @@ -104,14 +115,14 @@ * keyboard and mouse events). It is called before the actual rendering * happens. */ - bool frameStarted(const FrameEvent& evt); + bool frameStarted(const Ogre::FrameEvent& evt); /*! \brief Update statistics * * This method is called after the frame is rendered and refreshes the * statistics. */ - bool frameEnded(const FrameEvent& evt); + bool frameEnded(const Ogre::FrameEvent& evt); /*! \brief Switch mousemode from buffered<->immediate */ @@ -121,33 +132,14 @@ */ void switchKeyMode(); - /*! \brief Performes updates when a key was pressed AND released - * - * This method is part of the KeyListener interface of OGRE - * - * It is called by the buffered KeyListener when a key was klicked (pressed - * and afterwards released + /*! Tell the frame listener to exit at the end of the next frame */ - void keyClicked(KeyEvent* e); + void requestShutdown(); - /*! \brief Performes updates when a key was released - * - * This method is part of the KeyListener interface of OGRE - * - * It is called by the buffered KeyListener when a key was released - */ - void keyPressed(KeyEvent* e); +protected: - /*! \brief Performes updates when a key was pressed - * - * This method is part of the KeyListener interface of OGRE - * - * It is called by the buffered KeyListener when a key was pressed - */ - void keyReleased(KeyEvent* e); + bool mShutdownRequested; -protected: - /*! \brief This method updates the status (FPS,Triangles,etc.) * * This method is called at the end of every frame to update the statistics @@ -158,74 +150,84 @@ */ void updateStats(); - /*! Value used to cycle thorugh the scene details */ int mSceneDetailIndex; + /*! Movement speed of the camera */ - Real mMoveSpeed; + Ogre::Real mMoveSpeed; + /*! Rotation speed of the camera */ - Degree mRotateSpeed; + Ogre::Degree mRotateSpeed; + /*! Handle to the debug overlay (which displays the OGRE logo and stats */ - Overlay* mDebugOverlay; + Ogre::Overlay* mDebugOverlay; + /*! An event processor used, if the mouse or the keyboard input is buffered */ - EventProcessor* mEventProcessor; - /*! An input reader for unbuffered mouse and keyboard input */ - InputReader* mInputDevice; - /*! Handle to the players camera so we can move it on mouse or keyboard - * input + Ogre::EventProcessor* mEventProcessor; + + /*! An input reader for unbuffered mouse and keyboard input */ - Camera* mCamera; + Ogre::InputReader* mInputDevice; + /*! Vector used to modify the movement of the camera */ - Vector3 mTranslateVector; + Ogre::Vector3 mTranslateVector; + /*! Handle to the window where the contents is shown (used for statistics * updates */ - RenderWindow* mWindow; + Ogre::RenderWindow* mWindow; + /*! Flag to determine whether the stats should be displayed or not */ bool mStatsOn; + /*! Flag to determine if the input of the keyboard is buffered or * unbuffered */ bool mUseBufferedInputKeys; + /*! Flag to determine if the input of the mouse is buffered or unbuffered */ bool mUseBufferedInputMouse; + /*! Flag to determine if the input can be switched from buffered to * unbuffered. This is only possible if we created an instance of this * class with at least one buffered input */ bool mInputTypeSwitchingOn; + /*! Variable holding the current number of screenshots made (used to create * the filename of the screenshot */ unsigned int mNumScreenShots; - /*! Value to move the camera */ - float mMoveScale; - /*! Value to rotate the camera */ - Degree mRotScale; + /*! Value to stop flickering of toggles */ - Real mTimeUntilNextToggle; - /*! Value to rotate the camera by X (=yaw) - */ - Radian mRotX; - /*! Value to rotate the camera by Y (=pitch) - */ - Radian mRotY; + Ogre::Real mTimeUntilNextToggle; + /*! Filtering method for the scene */ - TextureFilterOptions mFiltering; + Ogre::TextureFilterOptions mFiltering; + /*! Number of anisotropic filtering processes */ int mAniso; + /*! Handle to the avatar */ Avatar* mAvatar; + + /*! Handle to a CEGUI Renderer */ + CEGUI::Renderer* mGUIRenderer; + + + Keyboard* mKeyboard; + Camera* mCamera; + Mouse* mMouse; }; #ifdef __cplusplus Added: include/gamestate.h =================================================================== --- include/gamestate.h (rev 0) +++ include/gamestate.h 2006-04-16 16:35:29 UTC (rev 54) @@ -0,0 +1,56 @@ +/*************************************************************************** + * gamestate.h + * + * Sat Apr 15 18:17:42 2006 + * Copyright 2006 User + * Email + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _GAMESTATE_H +#define _GAMESTATE_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +class Gamestate { +public: + Gamestate(); + + bool setGamestate(int state); + + int getGamestate(); + + + static const int GAME = 0; + static const int MENU = 1; + static const int MIN = GAME; + static const int MAX = MENU; + +private: + + int mActivestate; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* _GAMESTATE_H */ Property changes on: include/gamestate.h ___________________________________________________________________ Name: svn:mime-type + text/x-c++hdr Name: svn:eol-style + native Added: include/keyboard.h =================================================================== --- include/keyboard.h (rev 0) +++ include/keyboard.h 2006-04-16 16:35:29 UTC (rev 54) @@ -0,0 +1,60 @@ +/*************************************************************************** + * keyboard.h + * + * Sat Apr 15 16:31:36 2006 + * Copyright 2006 User + * Email + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _KEYBOARD_H +#define _KEYBOARD_H + +#include <OgreInput.h> +#include <OgreFrameListener.h> +#include "avatar.h" +#include "camera.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +class Keyboard { +public: + Keyboard(Ogre::InputReader* mInputDevice, Avatar* avatar, Camera* camera); + bool processKeyInput(const Ogre::FrameEvent& evt); + void setScale(float moveScale); +private: + /*! Handle to the input device, which will give us keyboard states */ + Ogre::InputReader* mInputDevice; + /*! Handle to the players avatar */ + Avatar* mAvatar; + /*! Value to move the camera */ + float mMoveScale; + /*! Handle to the camera chasing the avatar (will be removed once the movement + * is completed) + */ + Camera* mCamera; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* _KEYBOARD_H */ Property changes on: include/keyboard.h ___________________________________________________________________ Name: svn:mime-type + text/x-c++hdr Name: svn:eol-style + native Added: include/mouse.h =================================================================== --- include/mouse.h (rev 0) +++ include/mouse.h 2006-04-16 16:35:29 UTC (rev 54) @@ -0,0 +1,89 @@ +/*************************************************************************** + * mouse.h + * + * Sat Apr 15 16:55:15 2006 + * Copyright 2006 User + * Email + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _MOUSE_H +#define _MOUSE_H + +#include <OgreInput.h> +#include <OgreFrameListener.h> +#include <OgreMath.h> +#include "avatar.h" +#include "camera.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +class Mouse { +public: + /*! \brief Creates a new camera to chase the players avatar + * + * This constructor saves the given avatar and the input device to translate + * mouse movement and button clicks into actions on the player. So if the + * mouse was moved the players avatar will move accordingly. + * \param mInputDevice an inputdevice to get the current mousestates from + * \param avatar the players avatar + */ + Mouse(Ogre::InputReader* mInputDevice, Avatar* avatar); + + /*! \brief This method performs actions depending on the mousestate + * + * This method reads the state from the input device (which were set at the + * begin of the current frame) and depending on the states it performs + * actions. + * \param evt the FrameEvent that happened (i.e. for getting the time since + * the last frame + */ + bool processMouseInput(const Ogre::FrameEvent& evt); + + /*! \brief Sets the amount the players avatar can rotate in this frame + * + * This method is called at the begin of the frame. Depending on the time + * passed since the last frame, the players avatar can rotate for a specific + * degree. This degree also depends on the ships details. + * \param rotScale the degree the ship can rotate + */ + void setScale(Ogre::Degree rotScale); + +private: + + /*! Handle to the players avatar so we can perform rotation actions to it */ + Avatar* mAvatar; + /*! Handle to the input device, which will give us mouse states */ + Ogre::InputReader* mInputDevice; + /*! Value to rotate the camera */ + Ogre::Degree mRotScale; + + Camera* mCamera; + Ogre::Vector3 mTranslateVector; + Ogre::Degree mRotX; + Ogre::Degree mRotY; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* _MOUSE_H */ Property changes on: include/mouse.h ___________________________________________________________________ Name: svn:mime-type + text/x-c++hdr Name: svn:eol-style + native Added: include/movable_object.h =================================================================== --- include/movable_object.h (rev 0) +++ include/movable_object.h 2006-04-16 16:35:29 UTC (rev 54) @@ -0,0 +1,104 @@ +/*************************************************************************** + * movable_object.h + * + * Sun Apr 16 15:30:28 2006 + * Copyright 2006 Christoph Brill <eg...@us...> + * Email + ****************************************************************************/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _MOVABLE_OBJECT_H +#define _MOVABLE_OBJECT_H + +#include <OgreVector3.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + +/*! \brief interface for objects that can be moved by player input + * \author Christoph Brill + */ +class MovableObject { +public: + + virtual ~MovableObject() {}; + + /*! \brief Moves the object + * + * This method moves the object in a given direction with a given scale + * + * \param direction The direction the object is moving (i.e. + * MovableObject::LEFT) + * \param scale The distance the object is moving (based on the time elapsed + * since the last frame) + */ + virtual bool move(const int direction, float scale) = 0; + + /*! \brief Rotates the object + * + * This method rotates the object in a given direction with a given scale + * + * \param direction The direction the object is rotating (i.e. + * MovableObject::YAW_LEFT) + * \param scale The degree the object is direction (based on the time + * elapsed since the last frame) + */ + virtual bool rotate(int direction, Ogre::Degree scale) = 0; + + void reset(); + + virtual void performMove() = 0; + + /*! Direction: left */ + static const int LEFT = 1; + /*! Direction: right */ + static const int RIGHT = 2; + /*! Direction: forward */ + static const int FRONT = 3; + /*! Direction: backward */ + static const int BACK = 4; + /*! Direction: up */ + static const int UP = 5; + /*! Direction: down */ + static const int DOWN = 6; + /*! Yaw: left */ + static const int YAW_LEFT = 7; + /*! Yaw: right */ + static const int YAW_RIGHT = 8; + /*! Roll: left */ + static const int ROLL_LEFT = 9; + /*! Roll: right */ + static const int ROLL_RIGHT = 10; + /*! Pitch: up */ + static const int PITCH_UP = 11; + /*! Pitch: down */ + static const int PITCH_DOWN = 12; + +protected: + bool mMoveEndOfFrame; + Ogre::Vector3 mTranslateVector; + Ogre::Quaternion mNewOrientation; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* _MOVABLE_OBJECT_H */ Property changes on: include/movable_object.h ___________________________________________________________________ Name: svn:mime-type + text/x-c++hdr Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |