Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7014 in orxonox.OLD for trunk/src/util


Ignore:
Timestamp:
Feb 3, 2006, 2:14:22 PM (19 years ago)
Author:
bensch
Message:

trunk: new algorithm for the Camera-Distance

Location:
trunk/src/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/state.cc

    r6874 r7014  
    1818#include "state.h"
    1919
     20
     21#include "camera.h"
     22
    2023#ifndef NULL
    2124#define NULL 0
     
    2629
    2730
    28 PNode* State::camera = NULL;
    29 PNode* State::cameraTarget = NULL;
     31Camera* State::camera = NULL;
     32CameraTarget* State::cameraTarget = NULL;
     33
     34PNode* State::cameraNode = NULL;
     35PNode* State::cameraTargetNode = NULL;
    3036
    3137SkyBox* State::skyBox = NULL;
     
    4955 *  sets camera and target of the current Camera
    5056*/
    51 void State::setCamera(PNode* camera, PNode* cameraTarget)
     57void State::setCamera(Camera* camera, CameraTarget* cameraTarget)
    5258{
    5359  State::camera = camera;
    5460  State::cameraTarget = cameraTarget;
     61  State::cameraNode = camera;
     62  State::cameraTargetNode = cameraTarget;
    5563}
  • trunk/src/util/state.h

    r6874 r7014  
    1010// FORWARD DECLARATION
    1111class PNode;
     12class Camera;
     13class CameraTarget;
    1214class WorldEntity;
    1315class Player;
     
    3032   //////////////
    3133  /** @param camera the PNode to the Camera, @param cameraTarget the PNode to the Camera's target */
    32   static void setCamera(PNode* camera, PNode* cameraTarget);
     34  static void setCamera(Camera* camera, CameraTarget* cameraTarget);
     35  static inline Camera* getCamera() { return State::camera; };
     36  static inline CameraTarget* getCameraTarget() { return State::cameraTarget; };
    3337  /** @returns a Pointer to the PNode of the Camera */
    34   static inline PNode* getCamera() { return State::camera; };
     38  static inline PNode* getCameraNode() { return State::cameraNode; };
    3539  /** @returns a Pointer to the CameraTarget */
    36   static inline PNode* getCameraTarget() { return State::cameraTarget; };
     40  static inline PNode* getCameraTargetNode() { return State::cameraTargetNode; };
    3741
    3842  ////////////////
     
    9599  State();
    96100
    97   static PNode*                 camera;             //!< A reference to the camera
    98   static PNode*                 cameraTarget;       //!< A reference to the cameraTarget
     101  static Camera*                camera;             //!< The current Camera.
     102  static CameraTarget*          cameraTarget;       //!< The Camera Target.
     103  static PNode*                 cameraNode;         //!< A reference to the camera
     104  static PNode*                 cameraTargetNode;   //!< A reference to the cameraTarget
    99105  static PNode*                 nullParent;         //!< A reference to the Null-PNode.
    100106  static ObjectManager*         objectManager;      //!< A reference to the current ObjectManager
Note: See TracChangeset for help on using the changeset viewer.