Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3635 in orxonox.OLD for orxonox/trunk/src/camera.h


Ignore:
Timestamp:
Mar 23, 2005, 12:24:48 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: reimplemented the Camera.
Camera is now a PNode and not a WorldEntity. I have taken out all the unnecessary stuff like ELLIPTIC_CAMERA and so on, and now it is more like it should be in the new Framework

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/camera.h

    r3608 r3635  
    77#define _CAMERA_H
    88
    9 #include "world_entity.h"
     9#include "p_node.h"
    1010
    1111class World;
     12class CameraTarget;
     13
    1214
    1315//! Camera
    1416/**
    15    This class controls the viewpoint from which the World is rendered. To use the
    16    Camera it has to be bound to a WorldEntity which serves as the reference focus
    17    point. The Camera itself calls the WorldEntity::get_lookat() and
    18    World::calc_camera_pos() functions to calculate the position it currently should
    19    be in.
     17   This class controls the viewpoint from which the World is rendered.
    2018*/
    21 
    22 enum CAMERA_MODE {NORMAL, SMOTH_FOLLOW, STICKY, ELLIPTICAL};
    23 
    24 class Camera : public WorldEntity {
     19class Camera : public PNode
     20{
    2521 private:
    26   WorldEntity* bound;           //!< the WorldEntity the Camera is bound to
    27   World* world;
    28  
    29   /* physical system - not needed yet */
    30   float m; //!< mass
    31   Vector *fs; //!< seil-kraft
    32   Vector *a;  //!< acceleration
    33   Vector *v;  //!< velocity
    34  
    35   /* elliptical camera mode variables */
    36   float cameraOffset;
    37   float cameraOffsetZ;
    38   float deltaTime;
    39   float t;
    40   Vector* r;
    41   float rAbs;
    42   float ka;
    43   float a0;
    44 
    45   Quaternion *from;
    46   Quaternion *to;
    47   Quaternion *res;
    48  
    49  
    50   CAMERA_MODE cameraMode; //!< saves the camera mode: how the camera follows the entity
    51  
    52   void updateDesiredPlace ();
     22  CameraTarget* target;
    5323 
    5424 public:
    55   Camera (World* world);
    56   virtual ~Camera ();
     25  Camera(void);
     26  virtual ~Camera(void);
     27
     28  void lookAt(PNode* target);
    5729 
    58   void tick (Uint32 deltaT);
     30  PNode* getTarget();
    5931  void apply ();
    60   void bind (WorldEntity* entity);
    61 
    62   void setWorld(World* world); 
    63 
    6432};
    6533
     34//! A CameraTarget is where the Camera is looking at.
     35class CameraTarget : public PNode
     36{
     37  friend class Camera; //!
     38 
     39 private:
     40  CameraTarget(void);
     41 
     42 public:
     43  virtual ~CameraTarget(void);
     44};
     45
     46
    6647#endif /* _CAMERA_H */
Note: See TracChangeset for help on using the changeset viewer.