Changeset 5414 in orxonox.OLD for trunk/src/lib/graphics/render2D
- Timestamp:
- Oct 21, 2005, 9:45:54 AM (19 years ago)
- Location:
- trunk/src/lib/graphics/render2D
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/render2D/element_2d.cc
r5404 r5414 367 367 368 368 /** 369 * @param absCoordSoft set absolute coordinate 370 * @param bias how fast to iterato to the new Coordinate 371 */ 372 void Element2D::setAbsCoorSoft2D (const Vector& absCoordSoft, float bias) 373 { 374 if (this->toCoordinate == NULL) 375 this->toCoordinate = new Vector(); 376 377 if( likely(this->parentMode & E2D_PARENT_MOVEMENT)) 378 { 379 /* if you have set the absolute coordinates this overrides all other changes */ 380 if (likely(this->parent != NULL)) 381 *this->toCoordinate = absCoordSoft - parent->getAbsCoor2D (); 382 else 383 *this->toCoordinate = absCoordSoft; 384 } 385 if( this->parentMode & E2D_PARENT_ROTATE_MOVEMENT) 386 { 387 if (likely(this->parent != NULL)) 388 *this->toCoordinate = absCoordSoft - parent->getAbsCoor2D (); 389 else 390 *this->toCoordinate = absCoordSoft; 391 } 392 393 this->bias = bias; 394 } 395 396 /** 397 * @param x x-coordinate. 398 * @param y y-coordinate. 399 * @param z z-coordinate. 400 * @see void PNode::setAbsCoor (const Vector& absCoord) 401 */ 402 void Element2D::setAbsCoorSoft2D (float x, float y, float depth, float bias) 403 { 404 this->setAbsCoorSoft2D(Vector(x, y, depth), bias); 405 } 406 407 /** 369 408 * shift coordinate ralative 370 409 * @param shift shift vector … … 439 478 440 479 this->bRelDirChanged = true; 480 } 481 482 /** 483 * sets the absolute direction softly 484 * @param absDir absolute coordinates 485 */ 486 void Element2D::setAbsDirSoft2D (float absDirSoft, float bias) 487 { 488 if (this->toDirection == NULL) 489 this->toDirection = new float; 490 491 if (likely(this->parent != NULL)) 492 *this->toDirection = absDirSoft - this->parent->getAbsDir2D(); 493 else 494 *this->toDirection = absDirSoft; 495 496 this->bias = bias; 441 497 } 442 498 -
trunk/src/lib/graphics/render2D/element_2d.h
r5404 r5414 134 134 void setAbsCoor2D (float x, float y, float depth = 1.0); 135 135 void setAbsCoor2Dpx (int x, int y); 136 void setAbsCoorSoft2D (const Vector& absCoordSoft, float bias = 1.0); 137 void setAbsCoorSoft2D (float x, float y, float depth = 1.0, float bias = 1.0); 136 138 /** @returns the absolute position */ 137 139 inline const Vector& getAbsCoor2D () const { return this->absCoordinate; }; … … 148 150 inline float getRelDirSoft2D() const { return (this->toDirection)?*this->toDirection:this->relDirection; }; 149 151 void setAbsDir2D (float absDir); 152 void setAbsDirSoft2D (float absDirSoft, float bias = 1.0); 150 153 /** @returns the absolute Direction */ 151 154 inline float getAbsDir2D () const { return this->absDirection; };
Note: See TracChangeset
for help on using the changeset viewer.