Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3683 in orxonox.OLD for orxonox/trunk/src/lib


Ignore:
Timestamp:
Mar 30, 2005, 9:37:52 PM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: projectile speed issue: fixed some strange behaveour. still got the problem, that the the projectile have variable relative speeds to the player…

Location:
orxonox/trunk/src/lib/coord
Files:
2 edited

Legend:

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

    r3675 r3683  
    258258
    259259/**
     260   \brief shift coordinate (abs and rel)
     261   \param shift vector
     262
     263   this function shifts the current coordinates about the vector shift. this is
     264   usefull because from some place else you can:
     265   PNode* someNode = ...;
     266   Vector objectMovement = calculateShift();
     267   someNode->shiftCoor(objectMovement);
     268
     269   elsewhere you would have to:
     270   PNode* someNode = ...;
     271   Vector objectMovement = calculateShift();
     272   Vector currentCoor = someNode->getRelCoor();
     273   Vector newCoor = currentCoor + objectMovement;
     274   someNode->setRelCoor(newCoor);
     275   
     276   yea right... shorter...
     277
     278*/
     279void PNode::shiftCoor (Vector shift)
     280{
     281  if( this->bAbsCoorChanged)
     282    {
     283      *this->absCoordinate = *this->absCoordinate + shift;
     284    }
     285  else
     286    {
     287      *this->relCoordinate = *this->relCoordinate + shift;
     288      this->bRelCoorChanged = true;
     289    }
     290}
     291
     292
     293
     294/**
    260295   \brief get relative direction
    261296   \returns relative direction to its parent
     
    353388*/
    354389void PNode::shiftDir (Quaternion* shift)
     390{}
     391
     392
     393/**
     394   \brief shift coordinate (abs and rel)
     395   \param shift vector
     396
     397   this function shifts the current coordinates about the vector shift. this is
     398   usefull because from some place else you can:
     399   PNode* someNode = ...;
     400   Quaternion objectMovement = calculateShift();
     401   someNode->shiftCoor(objectMovement);
     402
     403   elsewhere you would have to:
     404   PNode* someNode = ...;
     405   Quaternion objectMovement = calculateShift();
     406   Quaternion currentCoor = someNode->getRelCoor();
     407   Quaternion newCoor = currentCoor + objectMovement;
     408   someNode->setRelCoor(newCoor);
     409   
     410   yea right... shorter...
     411
     412   \todo implement this
     413*/
     414void PNode::shiftDir (Quaternion shift)
    355415{}
    356416
  • orxonox/trunk/src/lib/coord/p_node.h

    r3675 r3683  
    6464  void setAbsCoor (Vector absCoord);
    6565  void shiftCoor (Vector* shift);
     66  void shiftCoor (Vector shift);
    6667  //void shiftCoor (Vector shift);
    6768
     
    7374  void setAbsDir (Quaternion absDir);
    7475  void shiftDir (Quaternion* shift);
     76  void shiftDir (Quaternion shift);
    7577
    7678  float getSpeed();
Note: See TracChangeset for help on using the changeset viewer.