Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10272 in orxonox.OLD for branches/camera/src


Ignore:
Timestamp:
Jan 17, 2007, 6:16:08 PM (18 years ago)
Author:
gfilip
Message:

evrything finally solved

Location:
branches/camera/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/camera/src/story_entities/game_world.cc

    r10258 r10272  
    551551  State::getCamera()->apply ();
    552552  State::getCamera()->project ();
    553   //this->dataTank->localCamera->apply ();
    554   //this->dataTank->localCamera->project ();
    555553  GraphicsEngine::storeMatrices();
    556554}
  • branches/camera/src/story_entities/game_world_data.cc

    r10259 r10272  
    3030#include "player.h"
    3131#include "camera.h"
     32#include "cameraman.h"
    3233#include "terrain.h"
    3334#include "skybox.h"
     
    99100  PNode::getNullParent();
    100101  Camera* localCamera = new Camera();
    101   localCamera->setName ("GameWorld-Camera");
     102    localCamera->setName ("GameWorld-Camera");
    102103  State::setCamera(localCamera, localCamera->getTarget());
    103 
     104  cameraman* camMan = new cameraman();
     105  State::setCameraman(camMan);
    104106  LightManager::getInstance();
    105107
     
    332334  LoadParamXML(root, "GameRule", this, GameWorldData, loadGameRule);
    333335
    334   LoadParam(root, "clip-region", State::getCamera(), Camera, setClipRegion);
     336  LoadParam(root, "clip-region", State::getCameraman(), cameraman, setClipRegion);
    335337
    336338
  • branches/camera/src/util/state.cc

    r9406 r10272  
    2020
    2121#include "camera.h"
     22#include "cameraman.h"
    2223
    2324#ifndef NULL
     
    3132Camera* State::camera = NULL;
    3233CameraTarget* State::cameraTarget = NULL;
     34
     35cameraman* State::CameraMan = NULL;
    3336
    3437PNode* State::cameraNode = NULL;
     
    6366  State::cameraTargetNode = cameraTarget;
    6467}
     68
     69
     70void State::setCameraman(cameraman* cm)
     71
     72{
     73  State::CameraMan=cm;
     74}
  • branches/camera/src/util/state.h

    r8408 r10272  
    1818class ObjectManager;
    1919class GameRules;
    20 
     20class cameraman;
    2121class ScriptManager;
    2222
     
    4242  /** @returns a Pointer to the CameraTarget */
    4343  static inline PNode* getCameraTargetNode() { return State::cameraTargetNode; };
     44
     45
     46
     47  /////////////////////
     48  /// CAMERAMANAGER ///
     49  /////////////////////
     50  /** @param cameraman the PNode to the CameraManager,*/
     51  static void setCameraman(cameraman*);
     52  static inline cameraman* getCameraman() { return State::CameraMan; };
     53
    4454
    4555  ////////////////
     
    116126  static Camera*                camera;             //!< The current Camera.
    117127  static CameraTarget*          cameraTarget;       //!< The Camera Target.
     128  static cameraman*             CameraMan;
    118129  static PNode*                 cameraNode;         //!< A reference to the camera
    119130  static PNode*                 cameraTargetNode;   //!< A reference to the cameraTarget
  • branches/camera/src/world_entities/cameraman.cc

    r10259 r10272  
    2121#include "sound_engine.h"
    2222
     23ObjectListDefinition(cameraman);
     24
    2325
    2426cameraman::cameraman()
    2527{
     28  this->registerObject(this, cameraman::_objectList);
     29
     30  this->nearClip = 1.0;
     31  this->farClip = 1000.0;
     32
    2633  currentCam=State::getCamera();
    2734  this->cameras.push_back(currentCam);
    28   currentCam->target->detach();
    2935  State::setCamera(currentCam, currentCam->getTarget());
     36//   currentCam->setClipRegion(nearClip, farClip);
    3037}
    3138
     
    3643  this->cameras.push_back(new Camera());
    3744  cameras[cameras.size()-1]->target->detach();
    38 
    39 
    40 
    41   cout << cameras[1]->getAbsCoorX() << "," << cameras[1]->getAbsCoorY() << "," << cameras[1]->getAbsCoorZ() << endl << cameras[1]->target->getAbsCoorX() << endl;
     45  cameras[cameras.size()-1]->setClipRegion(nearClip, farClip);
    4246
    4347}
     
    97101
    98102
     103
     104void cameraman::setClipRegion(float nearCli, float farCli)
     105{
     106  this->nearClip=nearCli;
     107  this->farClip=farCli;
     108
     109  for(int i = 0; i < this->cameras.size(); i++)
     110    cameras[i]->setClipRegion(nearCli, farCli);
     111}
     112
     113
    99114void cameraman::jumpCurrCam(int x, int y, int z)
    100115{
  • branches/camera/src/world_entities/cameraman.h

    r10257 r10272  
    55#include "camera.h"
    66#include <vector>
     7#include "base_object.h"
    78
    8 class cameraman {
     9class cameraman : public BaseObject {
     10  ObjectListDeclaration(cameraman);
    911
    1012  private:
    1113    Camera* currentCam;
    12    // int camNo;
    13 
     14    float nearClip;
     15    float farClip;
    1416
    1517
     
    2830    void changeSpeed(float speed);
    2931    void testCam();
    30 
     32    void setClipRegion(float nearClip, float farClip);
    3133
    3234
  • branches/camera/src/world_entities/test_entity.cc

    r10262 r10272  
    2323#include "test_entity.h"
    2424#include "debug.h"
    25 #include <iostream.h>
    2625#include "state.h"
    2726#include "shell_command.h"
     
    8079void TestEntity::test()
    8180{
    82   CM= new cameraman();
     81  CM= State::getCameraman();
    8382  CM->createCam();
    84   //CM->moveCurrCam(-300, 0, 0);
    8583  CM->moveCam(-300, 0, 0, 0);
    8684}
     
    10098void TestEntity::t4()
    10199{
    102   cout << CM->cameras[1]->getAbsCoorX() << endl <<CM->cameras[1]->getAbsCoorY() << endl <<CM->cameras[1]->getAbsCoorZ() << endl << CM->cameras[1]->target->getAbsCoorX() << endl;
    103   CM->testCam();
    104   cout << CM->cameras[1]->getAbsCoorX() << endl <<CM->cameras[1]->getAbsCoorY() << endl <<CM->cameras[1]->getAbsCoorZ() << endl << CM->cameras[1]->target->getAbsCoorX() << endl;
     100
    105101}
    106102
Note: See TracChangeset for help on using the changeset viewer.