Changeset 3681 in orxonox.OLD for orxonox/branches/textEngine/src/camera.h
- Timestamp:
- Mar 30, 2005, 9:02:23 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/textEngine/src/camera.h
r3365 r3681 7 7 #define _CAMERA_H 8 8 9 #include "stdincl.h" 10 #include "world_entity.h" 11 9 #include "p_node.h" 10 #include "vector.h" 12 11 13 12 class World; 13 class CameraTarget; 14 15 enum ViewMode{VIEW_NORMAL, VIEW_BEHIND, VIEW_FRONT, VIEW_LEFT, VIEW_RIGHT, VIEW_TOP}; 14 16 15 17 //! Camera 16 18 /** 17 This class controls the viewpoint from which the World is rendered. To use the 18 Camera it has to be bound to a WorldEntity which serves as the reference focus 19 point. The Camera itself calls the WorldEntity::get_lookat() and 20 World::calc_camera_pos() functions to calculate the position it currently should 21 be in. 19 This class controls the viewpoint from which the World is rendered. 22 20 */ 21 class Camera : public PNode 22 { 23 private: 24 CameraTarget* target; //!< The Target of the Camera (where this Camera Looks at) 23 25 24 enum CAMERA_MODE {NORMAL, SMOTH_FOLLOW, STICKY, ELLIPTICAL}; 26 float fovy; //!< The field of view Angle (in degrees). 27 float aspectRatio; //!< The aspect ratio (width / height). 28 float nearClip; //!< The near clipping plane. 29 float farClip; //!< The far clipping plane. 25 30 26 class Camera : public WorldEntity { 27 private: 28 WorldEntity* bound; //!< the WorldEntity the Camera is bound to 29 World* world; 30 31 /* physical system - not needed yet */ 32 float m; //!< mass 33 Vector *fs; //!< seil-kraft 34 Vector *a; //!< acceleration 35 Vector *v; //!< velocity 36 37 /* elliptical camera mode variables */ 38 float cameraOffset; 39 float cameraOffsetZ; 40 float deltaTime; 41 float t; 42 Vector r; 43 float rAbs; 44 float ka; 45 float a0; 46 47 Quaternion *from; 48 Quaternion *to; 49 Quaternion *res; 50 51 52 CAMERA_MODE cameraMode; //!< saves the camera mode: how the camera follows the entity 53 54 void updateDesiredPlace (); 31 Vector toRelCoor; 32 float toFovy; 55 33 56 34 public: 57 Camera (World* world); 58 ~Camera (); 59 60 void timeSlice (Uint32 deltaT); 61 void apply (); 62 void bind (WorldEntity* entity); 63 void destroy(); 35 Camera(void); 36 virtual ~Camera(void); 64 37 65 void setWorld(World* world); 38 void lookAt(PNode* target); 39 PNode* getTarget(); 66 40 41 void setAspectRatio(float aspectRatio); 42 void setFovy(float fovy); 43 void setClipRegion(float nearClip, float farClip); 44 45 void setViewMode(ViewMode mode); 46 void tick(float dt); 47 void apply (void); 67 48 }; 68 49 50 //! A CameraTarget is where the Camera is looking at. 51 class CameraTarget : public PNode 52 { 53 friend class Camera; //! The CameraTarget is a friend of Camera. noone else needs a CameraTarget, so noone else can create it. 54 55 private: 56 CameraTarget(void); 57 58 public: 59 virtual ~CameraTarget(void); 60 }; 61 62 69 63 #endif /* _CAMERA_H */
Note: See TracChangeset
for help on using the changeset viewer.