- Timestamp:
- Jan 17, 2007, 6:16:08 PM (18 years ago)
- Location:
- branches/camera/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/camera/src/story_entities/game_world.cc
r10258 r10272 551 551 State::getCamera()->apply (); 552 552 State::getCamera()->project (); 553 //this->dataTank->localCamera->apply ();554 //this->dataTank->localCamera->project ();555 553 GraphicsEngine::storeMatrices(); 556 554 } -
branches/camera/src/story_entities/game_world_data.cc
r10259 r10272 30 30 #include "player.h" 31 31 #include "camera.h" 32 #include "cameraman.h" 32 33 #include "terrain.h" 33 34 #include "skybox.h" … … 99 100 PNode::getNullParent(); 100 101 Camera* localCamera = new Camera(); 101 localCamera->setName ("GameWorld-Camera");102 localCamera->setName ("GameWorld-Camera"); 102 103 State::setCamera(localCamera, localCamera->getTarget()); 103 104 cameraman* camMan = new cameraman(); 105 State::setCameraman(camMan); 104 106 LightManager::getInstance(); 105 107 … … 332 334 LoadParamXML(root, "GameRule", this, GameWorldData, loadGameRule); 333 335 334 LoadParam(root, "clip-region", State::getCamera (), Camera, setClipRegion);336 LoadParam(root, "clip-region", State::getCameraman(), cameraman, setClipRegion); 335 337 336 338 -
branches/camera/src/util/state.cc
r9406 r10272 20 20 21 21 #include "camera.h" 22 #include "cameraman.h" 22 23 23 24 #ifndef NULL … … 31 32 Camera* State::camera = NULL; 32 33 CameraTarget* State::cameraTarget = NULL; 34 35 cameraman* State::CameraMan = NULL; 33 36 34 37 PNode* State::cameraNode = NULL; … … 63 66 State::cameraTargetNode = cameraTarget; 64 67 } 68 69 70 void State::setCameraman(cameraman* cm) 71 72 { 73 State::CameraMan=cm; 74 } -
branches/camera/src/util/state.h
r8408 r10272 18 18 class ObjectManager; 19 19 class GameRules; 20 20 class cameraman; 21 21 class ScriptManager; 22 22 … … 42 42 /** @returns a Pointer to the CameraTarget */ 43 43 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 44 54 45 55 //////////////// … … 116 126 static Camera* camera; //!< The current Camera. 117 127 static CameraTarget* cameraTarget; //!< The Camera Target. 128 static cameraman* CameraMan; 118 129 static PNode* cameraNode; //!< A reference to the camera 119 130 static PNode* cameraTargetNode; //!< A reference to the cameraTarget -
branches/camera/src/world_entities/cameraman.cc
r10259 r10272 21 21 #include "sound_engine.h" 22 22 23 ObjectListDefinition(cameraman); 24 23 25 24 26 cameraman::cameraman() 25 27 { 28 this->registerObject(this, cameraman::_objectList); 29 30 this->nearClip = 1.0; 31 this->farClip = 1000.0; 32 26 33 currentCam=State::getCamera(); 27 34 this->cameras.push_back(currentCam); 28 currentCam->target->detach();29 35 State::setCamera(currentCam, currentCam->getTarget()); 36 // currentCam->setClipRegion(nearClip, farClip); 30 37 } 31 38 … … 36 43 this->cameras.push_back(new Camera()); 37 44 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); 42 46 43 47 } … … 97 101 98 102 103 104 void 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 99 114 void cameraman::jumpCurrCam(int x, int y, int z) 100 115 { -
branches/camera/src/world_entities/cameraman.h
r10257 r10272 5 5 #include "camera.h" 6 6 #include <vector> 7 #include "base_object.h" 7 8 8 class cameraman { 9 class cameraman : public BaseObject { 10 ObjectListDeclaration(cameraman); 9 11 10 12 private: 11 13 Camera* currentCam; 12 // int camNo;13 14 float nearClip; 15 float farClip; 14 16 15 17 … … 28 30 void changeSpeed(float speed); 29 31 void testCam(); 30 32 void setClipRegion(float nearClip, float farClip); 31 33 32 34 -
branches/camera/src/world_entities/test_entity.cc
r10262 r10272 23 23 #include "test_entity.h" 24 24 #include "debug.h" 25 #include <iostream.h>26 25 #include "state.h" 27 26 #include "shell_command.h" … … 80 79 void TestEntity::test() 81 80 { 82 CM= new cameraman();81 CM= State::getCameraman(); 83 82 CM->createCam(); 84 //CM->moveCurrCam(-300, 0, 0);85 83 CM->moveCam(-300, 0, 0, 0); 86 84 } … … 100 98 void TestEntity::t4() 101 99 { 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 105 101 } 106 102
Note: See TracChangeset
for help on using the changeset viewer.