Changeset 10272 in orxonox.OLD for branches/camera/src/world_entities
- Timestamp:
- Jan 17, 2007, 6:16:08 PM (17 years ago)
- Location:
- branches/camera/src/world_entities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
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.