Changeset 5108 in orxonox.OLD for trunk/src/lib/graphics/render2D
- Timestamp:
- Aug 23, 2005, 9:51:20 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
r5107 r5108 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(); -
trunk/src/lib/graphics/render2D/element_2d.h
r5089 r5108 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);
Note: See TracChangeset
for help on using the changeset viewer.