Changeset 5113 in orxonox.OLD for trunk/src/lib/graphics/render2D
- Timestamp:
- Aug 23, 2005, 11:18:39 PM (19 years ago)
- Location:
- trunk/src/lib/graphics/render2D
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/render2D/element_2d.cc
r5111 r5113 214 214 void Element2D::setRelCoor2D (const Vector& relCoord) 215 215 { 216 if (this->toCoordinate!= NULL) 217 { 218 delete this->toCoordinate; 219 this->toCoordinate = NULL; 220 } 216 221 this->relCoordinate = relCoord; 217 222 this->bRelCoorChanged = true; … … 227 232 void Element2D::setRelCoor2D (float x, float y, float z) 228 233 { 229 this->set AbsCoor2D(Vector(x,y,z));234 this->setRelCoor2D(Vector(x,y,z)); 230 235 } 231 236 … … 288 293 void Element2D::setAbsCoor2D (const Vector& absCoord) 289 294 { 295 if (this->toCoordinate!= NULL) 296 { 297 delete this->toCoordinate; 298 this->toCoordinate = NULL; 299 } 300 290 301 if( likely(this->parentMode & E2D_PARENT_MOVEMENT)) 291 302 { … … 362 373 void Element2D::setRelDir2D (float relDir) 363 374 { 375 if (this->toDirection!= NULL) 376 { 377 delete this->toDirection; 378 this->toDirection = NULL; 379 } 380 364 381 this->relDirection = relDir; 365 382 this->bRelDirChanged = true; … … 386 403 void Element2D::setAbsDir2D (float absDir) 387 404 { 405 if (this->toDirection!= NULL) 406 { 407 delete this->toDirection; 408 this->toDirection = NULL; 409 } 410 388 411 if (likely(this->parent != NULL)) 389 412 this->relDirection = absDir - this->parent->getAbsDir2D(); … … 712 735 { 713 736 tIterator<Element2D>* iterator = this->children->getIterator(); 714 //PNode* pn = this->children->enumerate ();715 737 Element2D* pn = iterator->nextElement(); 716 738 while( pn != NULL) -
trunk/src/lib/graphics/render2D/element_2d.h
r5111 r5113 108 108 /** @returns the relative position */ 109 109 inline const Vector& getRelCoor2D () const { return this->prevRelCoordinate; }; 110 /** @returns the Relative Coordinate Destination */ 111 inline const Vector& getRelCoorSoft2D() const { return (this->toCoordinate)?*this->toCoordinate:this->relCoordinate; }; 110 112 const Vector& getRelCoor2Dpx() const; 111 113 void setAbsCoor2D (const Vector& absCoord); … … 123 125 /** @returns the relative Direction */ 124 126 inline float getRelDir2D () const { return this->prevRelDirection; }; 127 /** @returns the Relative Directional Destination */ 128 inline float getRelDirSoft2D() const { return (this->toDirection)?*this->toDirection:this->relDirection; }; 125 129 void setAbsDir2D (float absDir); 126 130 /** @returns the absolute Direction */
Note: See TracChangeset
for help on using the changeset viewer.