Changeset 10204 in orxonox.OLD for branches/camera/src
- Timestamp:
- Jan 10, 2007, 1:18:46 PM (18 years ago)
- Location:
- branches/camera/src/world_entities
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/camera/src/world_entities/camera.cc
r10189 r10204 75 75 { 76 76 return (PNode*)this->target; 77 } 78 79 void Camera::setTargetNode(PNode* target) 80 { 81 this->target->setParent(target); 77 82 } 78 83 … … 157 162 158 163 //iterate(float dt, translate, target) 159 target->translate( 1,dt);164 target->translate(dt); 160 165 } 161 166 … … 353 358 354 359 355 void CameraTarget::translate(float speed, floatdt)360 void CameraTarget::translate(float dt) 356 361 { 357 362 if (fabs(translateTo.len() - (target->getAbsCoor()).len()) >= 11 ) … … 360 365 Vector tmpVec= iterate(dt, &translateTo, &(State::getCameraNode()->getAbsCoor())); 361 366 glLoadIdentity(); 362 target->shiftCoor( tmpVec.x, tmpVec.y,tmpVec.z);367 target->shiftCoor(speed*tmpVec.x, speed*tmpVec.y, speed*tmpVec.z); 363 368 // cout << "%%" << tmpVec.x << "%%"; 364 369 … … 371 376 } 372 377 373 void CameraTarget::jump(Vector *newPos)374 { 375 //target->setAbsCoor(newPos);378 void CameraTarget::jump(Vector newPos) 379 { 380 target->setAbsCoor(newPos); 376 381 } 377 382 -
branches/camera/src/world_entities/camera.h
r10198 r10204 41 41 CameraTarget* getTarget() const { return this->target; }; 42 42 PNode* getTargetNode() const; 43 43 void setTargetNode(PNode* target); 44 44 void setAspectRatio(float aspectRatio); 45 45 void setClipRegion(float nearClip, float farClip); … … 66 66 67 67 void process(const Event &event); 68 CameraTarget* target; //!< The Target of the Camera (where this Camera Looks at) 68 69 69 70 private: 70 CameraTarget* target; //!< The Target of the Camera (where this Camera Looks at)71 71 72 72 float fovy; //!< The field of view Angle (in degrees). … … 87 87 class CameraTarget : public PNode 88 88 { 89 friend class Camera; 89 friend class Camera; //! The CameraTarget is a friend of Camera. noone else needs a CameraTarget, so noone else can create it. 90 90 ObjectListDeclaration(CameraTarget); 91 91 … … 102 102 void atach(PNode* object); 103 103 Vector iterate(float dt, const Vector* target, const Vector* cam); 104 void translate(float speed, floatdt);104 void translate(float dt); 105 105 void changeSpeed(float speed); 106 106 Vector* rotate(Vector* newPos, float speed); 107 void jump(Vector *newPos);107 void jump(Vector newPos); 108 108 void test(); 109 109 void translateNow(Vector* vec); -
branches/camera/src/world_entities/cameraman.cc
r10198 r10204 36 36 37 37 38 39 void cameraman::moveCurrCam(int x, int y, int z) 40 { 41 currentCam->target->trans(x,y,z); 42 } 43 44 45 void cameraman::moveCam(int x, int y, int z, int camNo) 46 { 47 cameras[camNo]->target->trans(x,y,z); 48 } 49 50 51 void cameraman::changeTarget(int camNo, PNode* target) 52 { 53 cameras[camNo]->setTargetNode(target); 54 } 55 56 57 void cameraman::changeCurrTarget(PNode* target) 58 { 59 currentCam->setTargetNode(target); 60 } 61 62 void cameraman::jumpCam(int x, int y, int z, int camNo) 63 { 64 // cameras[camNo] 65 } 66 67 68 void jumpCurrCam(int x, int y, int z) 69 { 70 } 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 -
branches/camera/src/world_entities/cameraman.h
r10199 r10204 19 19 void createCam(); 20 20 Camera* cameras[6]; 21 void moveCam(int x, int y, int z, int speed,int camNo);22 void moveCurrCam(int x, int y, int z , int speed);21 void moveCam(int x, int y, int z, int camNo); 22 void moveCurrCam(int x, int y, int z); 23 23 void changeTarget(int camNo, PNode* target); 24 24 void changeCurrTarget(PNode* target); 25 25 void jumpCam(int x, int y, int z, int camNo); 26 void jumpC am(int x, int y, int z);27 26 void jumpCurrCam(int x, int y, int z); 27 void changeSpeed(float speed); 28 28 29 29
Note: See TracChangeset
for help on using the changeset viewer.