Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5108 in orxonox.OLD for trunk


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
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/coord/p_node.cc

    r5091 r5108  
    165165void PNode::setRelCoor (const Vector& relCoord)
    166166{
     167  if (this->toCoordinate!= NULL)
     168  {
     169    delete this->toCoordinate;
     170    this->toCoordinate = NULL;
     171  }
     172
    167173  this->relCoordinate = relCoord;
    168174  this->bRelCoorChanged = true;
     
    213219void PNode::setAbsCoor (const Vector& absCoord)
    214220{
     221  if (this->toCoordinate!= NULL)
     222  {
     223    delete this->toCoordinate;
     224    this->toCoordinate = NULL;
     225  }
     226
    215227  if( likely(this->parentMode & PNODE_MOVEMENT))
    216228  {
     
    276288void PNode::setRelDir (const Quaternion& relDir)
    277289{
     290  if (this->toDirection!= NULL)
     291  {
     292    delete this->toDirection;
     293    this->toDirection = NULL;
     294  }
    278295  this->relDirection = relDir;
    279296  this->bRelCoorChanged = true;
     
    327344void PNode::setAbsDir (const Quaternion& absDir)
    328345{
     346  if (this->toDirection!= NULL)
     347  {
     348    delete this->toDirection;
     349    this->toDirection = NULL;
     350  }
     351
    329352  if (likely(this->parent != NULL))
    330353    this->relDirection = absDir / this->parent->getAbsDir();
  • 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);
  • trunk/src/util/shell.cc

    r5107 r5108  
    252252   {
    253253     Text* lastText = this->bufferText[this->bufferDisplaySize-1];
    254      Vector firstCoord = this->bufferText[0]->getRelCoor2D();
     254     Vector firstCoord = this->bufferText[0]->getRelCoorSoft2D();
    255255
    256256     Text* swapText;
    257257     Text* moveText = this->bufferText[0];
    258      this->bufferText[0]->setRelCoor2D(this->bufferText[1]->getRelCoor2D());
     258     this->bufferText[0]->setRelCoorSoft2D(this->bufferText[1]->getRelCoorSoft2D(), 5);
    259259     for (unsigned int i = 1; i < this->bufferDisplaySize; i++)
    260260     {
    261261       if ( i < this->bufferDisplaySize-1)
    262          this->bufferText[i]->setRelCoor2D(this->bufferText[i+1]->getRelCoor2D());
     262         this->bufferText[i]->setRelCoorSoft2D(this->bufferText[i+1]->getRelCoorSoft2D(),5);
    263263       swapText = this->bufferText[i];
    264264       this->bufferText[i] = moveText;
Note: See TracChangeset for help on using the changeset viewer.