Changeset 7031 in orxonox.OLD for trunk/src/lib/graphics/render2D/element_2d.cc
- Timestamp:
- Feb 4, 2006, 4:42:28 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/render2D/element_2d.cc
r7029 r7031 55 55 this->toCoordinate = NULL; 56 56 this->toDirection = NULL; 57 this->toSize = NULL; 57 58 this->setSize2D(1, 1); 58 59 … … 221 222 } 222 223 224 void Element2D::setSizeSoft2D(float x, float y, float bias) 225 { 226 if (likely(this->toSize == NULL)) 227 this->toSize = new Vector2D(); 228 229 *this->toSize = Vector2D(x,y);; 230 this->bias = bias; 231 } 232 233 223 234 224 235 /** … … 247 258 this->bRelCoorChanged = true; 248 259 } 249 250 260 251 261 /** … … 798 808 } 799 809 } 810 if (unlikely(this->toSize != NULL)) 811 { 812 Vector2D shiftSize = (*this->toSize - Vector2D(this->sizeX, this->sizeY)) *fabsf(dt)*bias; 813 if (likely((shiftSize).len() >= .001))//PNODE_ITERATION_DELTA)) 814 { 815 this->sizeX += shiftSize.x; 816 this->sizeY += shiftSize.y; 817 } 818 else 819 { 820 delete this->toSize; 821 this->toSize = NULL; 822 PRINTF(5)("SmoothRotate of %s finished\n", this->getName()); 823 } 824 } 800 825 801 826 // MAIN UPDATE /////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.