Changeset 10238 in orxonox.OLD for branches/camera/src
- Timestamp:
- Jan 16, 2007, 7:55:24 PM (18 years ago)
- Location:
- branches/camera/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/camera/src/story_entities/game_world.cc
r9869 r10238 548 548 void GameWorld::applyCameraSettings() 549 549 { 550 this->dataTank->localCamera->apply (); 551 this->dataTank->localCamera->project (); 550 551 State::getCamera()->apply (); 552 State::getCamera()->project (); 553 //this->dataTank->localCamera->apply (); 554 //this->dataTank->localCamera->project (); 552 555 GraphicsEngine::storeMatrices(); 553 556 } -
branches/camera/src/world_entities/blackscreen.cc
r10236 r10238 50 50 if( root != NULL) 51 51 this->loadParams(root); 52 i=0 ;52 i=0.5; 53 53 state=0; 54 54 } … … 115 115 116 116 glColor4f(0, 0, 0, i); 117 this->material->select();117 /*this->material->select(); 118 118 glBegin(GL_QUADS); 119 119 glVertex3f(State::getCameraNode()->getAbsCoorX()+3,State::getCameraNode()->getAbsCoorY() -100.0f, … … 125 125 glVertex3f(State::getCameraNode()->getAbsCoorX()+3, State::getCameraNode()->getAbsCoorY()+100.0f, 126 126 State::getCameraNode()->getAbsCoorZ()-100.0f); 127 */ 128 129 glBegin(GL_QUADS); 130 glVertex3f(0,-100.0f,-100.0f); 131 glVertex3f(0,-100.0f,+100.0f); 132 glVertex3f(0,+100.0f,+100.0f); 133 glVertex3f(0,+100.0f,-100.0f); 134 127 135 128 136 -
branches/camera/src/world_entities/camera.cc
r10236 r10238 19 19 #include "glincl.h" 20 20 #include "vector.h" 21 #include "state.h"22 21 #include "shell_command.h" 23 22 #include "targets.h" … … 37 36 this->setName("camera"); 38 37 this->target = new CameraTarget(); 39 38 this->target->masta=this; 40 39 this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW0); 41 40 this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW1); … … 318 317 rotateBy.z=0; 319 318 target=createStick(); 320 321 319 } 322 320 … … 324 322 void CameraTarget::detach() 325 323 { 326 State::getCameraNode()->setParentSoft(target);327 State::getCameraTargetNode()->setParentSoft(target);324 masta->setParentSoft(target); 325 masta->getTargetNode()->setParentSoft(target); 328 326 } 329 327 … … 336 334 void CameraTarget::atach(PNode* object) 337 335 { 338 State::getCameraNode()->setParentSoft(object);339 State::getCameraTargetNode()->setParentSoft(object);340 } 341 342 343 344 345 Vector CameraTarget::iterate(float dt, const Vector* target, const Vector* cam)336 masta->setParentSoft(object); 337 masta->getTargetNode()->setParentSoft(object); 338 } 339 340 341 342 343 Vector CameraTarget::iterate(float dt, const Vector* Target, const Vector* cam) 346 344 { 347 345 348 346 349 347 Vector tmpVec; 350 tmpVec= (* target - *cam);348 tmpVec= (*Target - *cam); 351 349 tmpVec.normalize(); 352 350 return tmpVec; … … 360 358 { 361 359 362 Vector tmpVec= iterate(dt, &translateTo, &( State::getCameraNode()->getAbsCoor()));360 Vector tmpVec= iterate(dt, &translateTo, &(masta->getAbsCoor())); 363 361 glLoadIdentity(); 364 362 target->shiftCoor(speed*tmpVec.x, speed*tmpVec.y, speed*tmpVec.z); … … 399 397 void CameraTarget::test() 400 398 { 401 glLoadIdentity(); 402 403 atach(target); 404 399 atach(target); 405 400 } 406 401 -
branches/camera/src/world_entities/camera.h
r10236 r10238 96 96 PNode* target; 97 97 PNode* freeTarget; 98 Camera* masta; 99 Vector translateTo; 100 Vector rotateBy; 101 98 102 99 103 public: 100 Vector translateTo; 101 Vector rotateBy; 104 102 105 void detach(); 103 106 void atach(PNode* object); -
branches/camera/src/world_entities/cameraman.cc
r10236 r10238 16 16 #include "shell_command.h" 17 17 #include "cameraman.h" 18 18 #include "game_world_data.h" 19 19 #include "state.h" 20 20 #include "iostream.h" 21 21 22 22 … … 24 24 cameraman::cameraman() 25 25 { 26 cout << "TTTT*" << cameras.size(); 26 27 currentCam=State::getCamera(); 27 28 this->cameras.push_back(currentCam); 28 29 currentCam->target->detach(); 29 30 cout << "TTTT*" << cameras.size(); 31 State::setCamera(currentCam, currentCam->getTarget()); 30 32 } 31 33 … … 33 35 void cameraman::createCam() 34 36 { 35 Camera* newCamera=new Camera(); 36 this->cameras.push_back(newCamera); 37 newCamera->target->detach(); 37 // Camera* newCamera=new Camera(); 38 this->cameras.push_back(new Camera()); 39 //cameras[cameras.size()-1]->target->detach(); 40 38 41 } 39 42 … … 42 45 if (cameraNo<cameras.size()) 43 46 { 47 cout << "TTTTT" << currentCam << "TTTT \n"; 44 48 currentCam=cameras[cameraNo]; 49 cout << "TTTT" << currentCam << "*" << cameras.size() << "*TTTTT\n" ; 45 50 State::setCamera(currentCam, currentCam->getTarget()); 51 cout << cameras[0]; 46 52 } 47 53 -
branches/camera/src/world_entities/test_entity.cc
r10236 r10238 26 26 27 27 #include "state.h" 28 29 28 #include "shell_command.h" 29 #include "game_world_data.h" 30 30 31 31 #include "class_id_DEPRECATED.h" … … 43 43 } 44 44 45 46 SHELL_COMMAND(test, TestEntity,test); 47 SHELL_COMMAND(t2, TestEntity,t2); 48 SHELL_COMMAND(t3, TestEntity,t3); 49 SHELL_COMMAND(t4, TestEntity, t4); 50 SHELL_COMMAND(t5, TestEntity,t5); 45 51 46 52 /** … … 70 76 this->registerObject(this, TestEntity::_objectList); 71 77 this->toList(OM_GROUP_00); 72 CM= new cameraman(); 73 test(); 78 74 79 } 75 80 76 81 void TestEntity::test() 77 82 { 78 CM ->moveCurrCam(-200, 0, 0);83 CM= new cameraman(); 79 84 CM->createCam(); 80 CM->moveCam(0, -200, 0, 1); 85 //CM->moveCurrCam(-300, 0, 0); 86 CM->moveCam(-300, 0, 0, 0); 87 } 88 89 void TestEntity::t2() 90 { 91 CM->moveCurrCam(+600, 0, 0); 92 93 } 94 95 void TestEntity::t3() 96 { 97 98 CM->setCam(1); 99 } 100 101 void TestEntity::t4() 102 { 103 CM->moveCurrCam(-500,0,0); 104 } 105 106 void TestEntity::t5() 107 { 108 CM->setCam(0); 81 109 } 82 110 -
branches/camera/src/world_entities/test_entity.h
r10236 r10238 24 24 virtual void loadParams(const TiXmlElement* root); 25 25 void test(); 26 void t2(); 27 void t3(); 28 void t4(); 29 void t5(); 26 30 void changeState (bool); 27 31 virtual void tick (float time);
Note: See TracChangeset
for help on using the changeset viewer.