Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7003 in orxonox.OLD for trunk


Ignore:
Timestamp:
Feb 3, 2006, 2:55:14 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: fixed a nasty PNode bug …
@patrick: you were right about it being still debugged :)

Location:
trunk/src
Files:
5 edited

Legend:

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

    r6959 r7003  
    215215
    216216  *this->toCoordinate = relCoordSoft;
    217   this->toStep = 0.0f;
    218217  this->bias = bias;
    219218}
     
    301300      *this->toCoordinate = absCoordSoft;
    302301  }
    303   this->toStep = 0.0f;
    304302}
    305303
     
    373371  *this->toDirection = relDirSoft;
    374372  this->bias = bias;
    375   this->toStep = 0.0f;
    376373  this->bRelDirChanged = true;
    377374}
     
    443440
    444441  this->bias = bias;
    445   this->toStep = 0.0f;
    446442  this->bRelDirChanged = true;
    447443}
     
    650646  }
    651647  this->bias = bias;
    652   this->toStep = 0.0f;
    653648
    654649  Vector tmpV = this->getAbsCoor();
     
    781776        if (unlikely(this->toDirection != NULL))
    782777        {
    783           this->toStep += fabs(dt) * bias;
    784778          //printf("%s::%s %f\n", this->getClassName(), this->getName(), this->toStep );
    785           Quaternion rotQuat = Quaternion::quatSlerp(this->relDirection,*this->toDirection, toStep);
    786           if (this->relDirection.distance(rotQuat) >PNODE_ITERATION_DELTA)
     779          Quaternion rotQuat = Quaternion::quatSlerp(this->relDirection,*this->toDirection, .1);
     780          if (this->relDirection.distance(rotQuat) > PNODE_ITERATION_DELTA)
    787781          {
    788782            this->relDirection = rotQuat;
     
    794788            this->toDirection = NULL;
    795789            PRINTF(5)("SmoothRotate of %s finished\n", this->getName());
     790            this->bRelDirChanged;
    796791          }
    797792        }
     
    817812          this->absCoordinate = this->parent->getAbsCoor() + this->relCoordinate;
    818813        }
    819         else if( this->parentMode & PNODE_ROTATE_MOVEMENT && this->bRelCoorChanged)
     814        else if( this->parentMode & PNODE_ROTATE_MOVEMENT && (this->bRelCoorChanged || this->bRelDirChanged))
    820815        {
    821816          /* update the current absCoordinate */
  • trunk/src/lib/coord/p_node.h

    r6873 r7003  
    224224  Quaternion*        toDirection;        //!< a direction to which to iterate. (This is used in conjunction with setParentSoft and set*DirSoft)
    225225  float              bias;               //!< how fast to iterate to the given position (default is 1)
    226   float              toStep;
    227226
    228227  PNode*             parent;             //!< a pointer to the parent node.
  • trunk/src/lib/math/quaternion.cc

    r6616 r7003  
    227227 *  outputs some nice formated debug information about this quaternion
    228228*/
    229 void Quaternion::debug()
     229void Quaternion::debug() const
    230230{
    231231  PRINT(0)("real a=%f; imag: x=%f y=%f z=%f\n", w, v.x, v.y, v.z);
    232232}
    233233
    234 void Quaternion::debug2()
     234void Quaternion::debug2() const
    235235{
    236236  Vector axis = this->getSpacialAxis();
  • trunk/src/lib/math/quaternion.h

    r6627 r7003  
    103103  static Quaternion quatSlerp(const Quaternion& from, const Quaternion& to, float t);
    104104
    105   void debug();
    106   void debug2();
     105  void debug() const;
     106  void debug2() const;
    107107
    108108
  • trunk/src/world_entities/space_ships/turbine_hover.cc

    r7001 r7003  
    121121  this->cameraNode.addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE);
    122122  //this->cameraNode.setParentMode(PNODE_ROTATE_MOVEMENT);
    123   this->cameraNode.setParent(this);
     123  //this->cameraNode.setParent(this);
    124124
    125125  // rotors
     
    273273
    274274  // TRYING TO FIX PNode.
    275 /*  this->cameraNode.setAbsCoorSoft(this->getAbsCoor() + Vector(0,5,0), 30);
    276   this->cameraNode.setAbsDirSoft(this->getAbsDir(), 30);*/
     275  this->cameraNode.setAbsCoorSoft(this->getAbsCoor() + Vector(0.0f, 5.0f, 0.0f), 30.0f);
     276  this->cameraNode.setRelDirSoft(this->getAbsDir(), 30.0f);
     277  this->cameraNode.getAbsDir().debug();
    277278}
    278279
Note: See TracChangeset for help on using the changeset viewer.