Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6307 in orxonox.OLD


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

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

Location:
trunk/src
Files:
5 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
  • trunk/src/story_entities/world.cc

    r6241 r6307  
    349349  if (this->sky != NULL)
    350350  {
    351     this->sky->setParent(this->localCamera);
    352     this->sky->setParentMode(PNODE_MOVEMENT);
     351    this->localCamera->addChild(sky);
    353352  }
    354353  SoundEngine::getInstance()->setListener(this->localCamera);
  • trunk/src/world_entities/skybox.cc

    r6142 r6307  
    6868  this->size = 100.0;
    6969
    70   this->material = new Material*[6];
    7170  for (int i = 0; i < 6; i++)
    7271    {
     
    9594  for (int i = 0; i < 6; i++)
    9695    delete this->material[i];
    97   delete[] this->material;
    98  }
     96}
    9997
    10098/**
  • trunk/src/world_entities/skybox.h

    r5511 r6307  
    4444  void rebuild();
    4545
    46   Material**      material;        //!< Materials for the SkyBox. sorted by number (0-5) top, bottom, left, right, front, back
     46  Material*       material[6];     //!< Materials for the SkyBox. sorted by number (0-5) top, bottom, left, right, front, back
    4747  float           size;            //!< Size of the SkyBox. This should match the frustum maximum range.
    4848
Note: See TracChangeset for help on using the changeset viewer.