Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3681 in orxonox.OLD for orxonox/branches/textEngine/src/camera.h


Ignore:
Timestamp:
Mar 30, 2005, 9:02:23 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/textEngine: merged trunk here.
merged with command:
svn merge ../trunk textEngine -r 3467:HEAD
no conflicts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/textEngine/src/camera.h

    r3365 r3681  
    77#define _CAMERA_H
    88
    9 #include "stdincl.h"
    10 #include "world_entity.h"
    11 
     9#include "p_node.h"
     10#include "vector.h"
    1211
    1312class World;
     13class CameraTarget;
     14
     15enum ViewMode{VIEW_NORMAL, VIEW_BEHIND, VIEW_FRONT, VIEW_LEFT, VIEW_RIGHT, VIEW_TOP};
    1416
    1517//! Camera
    1618/**
    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.
    2220*/
     21class Camera : public PNode
     22{
     23 private:
     24  CameraTarget* target;            //!< The Target of the Camera (where this Camera Looks at)
    2325
    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.
    2530
    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;
    5533 
    5634 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);
    6437
    65   void setWorld(World* world); 
     38  void lookAt(PNode* target);
     39  PNode* getTarget();
    6640
     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);
    6748};
    6849
     50//! A CameraTarget is where the Camera is looking at.
     51class 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
    6963#endif /* _CAMERA_H */
Note: See TracChangeset for help on using the changeset viewer.