Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef OGRE_TOOLS_FPS_CAMERA_H_
00031 #define OGRE_TOOLS_FPS_CAMERA_H_
00032
00033 #include "camera_base.h"
00034
00035 namespace Ogre
00036 {
00037 class Camera;
00038 class SceneNode;
00039 class SceneManager;
00040 }
00041
00042 namespace ogre_tools
00043 {
00044
00049 class FPSCamera : public CameraBase
00050 {
00051 public:
00052 FPSCamera( Ogre::SceneManager* scene_manager );
00053 virtual ~FPSCamera();
00054
00055 float getPitch() { return pitch_; }
00056 float getYaw() { return yaw_; }
00057
00058 virtual void yaw( float angle );
00059 virtual void pitch( float angle );
00060 virtual void roll( float angle );
00061 virtual void setOrientation( float x, float y, float z, float w );
00062 virtual void setPosition( float x, float y, float z );
00063 virtual void setFrom( CameraBase* camera );
00064 virtual void relativeNodeChanged();
00065
00066 virtual Ogre::Vector3 getPosition();
00067 virtual Ogre::Quaternion getOrientation();
00068
00069 virtual void lookAt( const Ogre::Vector3& point );
00070
00071 virtual void move( float x, float y, float z );
00072 virtual void mouseLeftDrag( int diff_x, int diff_y, bool ctrl, bool alt, bool shift );
00073 virtual void mouseMiddleDrag( int diff_x, int diff_y, bool ctrl, bool alt, bool shift );
00074 virtual void mouseRightDrag( int diff_x, int diff_y, bool ctrl, bool alt, bool shift );
00075 virtual void scrollWheel( int diff, bool ctrl, bool alt, bool shift );
00076
00077 virtual void fromString(const std::string& str);
00078 virtual std::string toString();
00079
00080 protected:
00084 void update();
00088 void normalizePitch();
00092 void normalizeYaw();
00093
00094 float pitch_;
00095 float yaw_;
00096 };
00097
00098 }
00099
00100 #endif