Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Dec 27, 2005, 12:20:32 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: PNode fix: PNODE_MOVEMENT didn't work, because the mask was bork

Location:
trunk/src/lib
Files:
2 edited

Legend:

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

    r6299 r6307  
    628628void PNode::setParentMode(PARENT_MODE parentMode)
    629629{
    630   this->parentMode &= (0xfff0 | parentMode);
     630  this->parentMode = ((this->parentMode & 0xfff0) | parentMode);
    631631}
    632632
     
    745745
    746746
    747         if( this->parentMode & PNODE_LOCAL_ROTATE && this->bRelDirChanged)
     747        if(this->bRelDirChanged && this->parentMode & PNODE_LOCAL_ROTATE )
    748748        {
    749749          /* update the current absDirection - remember * means rotation around sth.*/
     
    752752        }
    753753
    754         if(likely(this->parentMode & PNODE_MOVEMENT && this->bRelCoorChanged))
     754        if(likely(this->bRelCoorChanged && this->parentMode & PNODE_MOVEMENT))
    755755        {
    756756        /* update the current absCoordinate */
    757         this->prevRelCoordinate = this->relCoordinate;
    758         this->absCoordinate = this->parent->getAbsCoor() + this->relCoordinate;
     757          this->prevRelCoordinate = this->relCoordinate;
     758          this->absCoordinate = this->parent->getAbsCoor() + this->relCoordinate;
    759759        }
    760760        else if( this->parentMode & PNODE_ROTATE_MOVEMENT && this->bRelCoorChanged)
    761761        {
    762762          /* update the current absCoordinate */
    763         this->prevRelCoordinate = this->relCoordinate;
    764         this->absCoordinate = this->parent->getAbsCoor() + parent->getAbsDir().apply(this->relCoordinate);
     763          this->prevRelCoordinate = this->relCoordinate;
     764          this->absCoordinate = this->parent->getAbsCoor() + parent->getAbsDir().apply(this->relCoordinate);
    765765        }
    766766        /////////////////////////////////////////////////
  • trunk/src/lib/graphics/render2D/element_2d.cc

    r6299 r6307  
    704704void Element2D::setParentMode2D(E2D_PARENT_MODE parentMode)
    705705{
    706   this->parentMode &= (0xfff0 | parentMode);
     706  this->parentMode = ((this->parentMode & 0xfff0) | parentMode);
    707707}
    708708
Note: See TracChangeset for help on using the changeset viewer.