Changeset 10238 in orxonox.OLD for branches/camera/src/world_entities/camera.cc
- Timestamp:
- Jan 16, 2007, 7:55:24 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.