Changeset 10110 in orxonox.OLD for branches/camera/src
- Timestamp:
- Dec 19, 2006, 11:24:58 PM (18 years ago)
- Location:
- branches/camera/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/camera/src/world_entities/camera.cc
r10106 r10110 153 153 154 154 //iterate(float dt, translate, target) 155 155 target->translate( 1,dt); 156 156 } 157 157 … … 289 289 290 290 SHELL_COMMAND(det, CameraTarget, detach); 291 SHELL_COMMAND(tes, CameraTarget, test); 292 291 293 292 294 … … 326 328 { 327 329 328 //this condititon if needed in tick: if (tmpVec.x >= 0.01) 330 329 331 Vector tmpVec; 330 332 tmpVec= (*target - *cam); … … 335 337 336 338 337 void CameraTarget::translate(Vector* newPos, float speed, float dt) 338 { 339 if (translateTo.x >= 0.01+this->getAbsCoorX()) 340 { 341 Vector tmpVec= iterate(dt, newPos, &(State::getCameraNode()->getAbsCoor())); 342 glTranslatef(tmpVec.x, tmpVec.y, tmpVec.z); 339 void CameraTarget::translate(float speed, float dt) 340 { 341 if (translateTo.x >= 0.01+State::getCameraNode()->getAbsCoorX() || translateTo.y 342 >= 0.01+State::getCameraNode()->getAbsCoorX() || translateTo.z 343 >= 0.01+State::getCameraNode()->getAbsCoorX()) 344 { 345 Vector tmpVec= iterate(dt, &translateTo, &(State::getCameraNode()->getAbsCoor())); 346 glLoadIdentity(); 347 glTranslatef(tmpVec.x, tmpVec.y, tmpVec.z); 343 348 } 344 349 } … … 352 357 { 353 358 359 } 360 361 void CameraTarget::translateNow(Vector* vec) 362 { 363 translateTo=*vec; 354 364 } 355 365 … … 360 370 return; 361 371 } 372 373 374 void CameraTarget::test() 375 { 376 //Vector* vec=new Vector(100,100,100); 377 //translateNow(vec); 378 glMatrixMode (GL_PROJECTION); 379 glLoadIdentity(); 380 glTranslatef(100, 100, 100); 381 } -
branches/camera/src/world_entities/camera.h
r10105 r10110 101 101 void atach(PNode* object); 102 102 Vector iterate(float dt, const Vector* target, const Vector* cam); 103 void translate( Vector* newPos,float speed, float dt);103 void translate(float speed, float dt); 104 104 void changeSpeed(float speed); 105 105 Vector* rotate(Vector* newPos, float speed); 106 106 void jump(Vector* newPos); 107 void test(); 108 void translateNow(Vector* vec); 107 109 }; 108 110
Note: See TracChangeset
for help on using the changeset viewer.