Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5108 in orxonox.OLD for trunk/src/lib/graphics/render2D


Ignore:
Timestamp:
Aug 23, 2005, 9:51:20 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: softDir/softCoor is now overwritten(deleted) if one sets the relCoor/relDir/absDir/absCoor
shell is also in smooth-mode now :)

Location:
trunk/src/lib/graphics/render2D
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/render2D/element_2d.cc

    r5107 r5108  
    214214void Element2D::setRelCoor2D (const Vector& relCoord)
    215215{
     216  if (this->toCoordinate!= NULL)
     217  {
     218    delete this->toCoordinate;
     219    this->toCoordinate = NULL;
     220  }
    216221  this->relCoordinate = relCoord;
    217222  this->bRelCoorChanged = true;
     
    227232void Element2D::setRelCoor2D (float x, float y, float z)
    228233{
    229   this->setAbsCoor2D(Vector(x,y,z));
     234  this->setRelCoor2D(Vector(x,y,z));
    230235}
    231236
     
    288293void Element2D::setAbsCoor2D (const Vector& absCoord)
    289294{
     295  if (this->toCoordinate!= NULL)
     296  {
     297    delete this->toCoordinate;
     298    this->toCoordinate = NULL;
     299  }
     300
    290301  if( likely(this->parentMode & E2D_PARENT_MOVEMENT))
    291302  {
     
    362373void Element2D::setRelDir2D (float relDir)
    363374{
     375  if (this->toDirection!= NULL)
     376  {
     377    delete this->toDirection;
     378    this->toDirection = NULL;
     379  }
     380
    364381  this->relDirection = relDir;
    365382  this->bRelDirChanged = true;
     
    386403void Element2D::setAbsDir2D (float absDir)
    387404{
     405  if (this->toDirection!= NULL)
     406  {
     407    delete this->toDirection;
     408    this->toDirection = NULL;
     409  }
     410
    388411  if (likely(this->parent != NULL))
    389412    this->relDirection = absDir - this->parent->getAbsDir2D();
  • trunk/src/lib/graphics/render2D/element_2d.h

    r5089 r5108  
    108108    /** @returns the relative position */
    109109    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; };
    110112    const Vector& getRelCoor2Dpx() const;
    111113    void setAbsCoor2D (const Vector& absCoord);
Note: See TracChangeset for help on using the changeset viewer.