Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3588 in orxonox.OLD for orxonox/trunk/src/track_manager.cc


Ignore:
Timestamp:
Mar 17, 2005, 2:47:16 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: name-fix for TrackManager and minor fix in Curve.
There has also been a little fix in the light-class: light is a BaseObject not a World-Entity

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/track_manager.cc

    r3556 r3588  
    3737  this->mainJoin = false;
    3838  this->ID = -1;
    39   this->startingTime = 0; //!< \todo eventually set this to the max time of TrackManager.
    40   this->duration = 1;
     39  this->startingTime = 0;
     40  this->duration = TMAN_DEFAULT_DURATION;
    4141  this->endTime = 1;
    4242  this->jumpTime = 0;
    43   this->curveType = BEZIERCURVE;
    4443  this->nodeCount = 0;
    4544  this->childCount = 0;
     
    115114
    116115/**
     116   \param name the Name to set.
     117*/
     118void TrackElement::setName(const char* name)
     119{
     120  //  delete the old name
     121  if (this->name)
     122    delete []this->name;
     123  // if a name was given already.
     124  if (name)
     125    {
     126      this->name = new char[strlen(name)+1];
     127      strcpy(this->name, name);
     128    }
     129  else
     130    this->name = NULL;
     131}
     132
     133/**
     134   \returns The name of this TrackElement
     135*/
     136char* TrackElement::getName(void) const
     137{
     138  return this->name;
     139}
     140
     141
     142/**
    117143   \brief CONDITION that chooses the first child for the decision (static)
    118144   \param nothing Nothing in this function
     
    266292      this->addPoint(this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount()), this->currentTrackElem->children[i]);
    267293    }
     294  if (childCount == 1)
     295    this->currentTrackElem->children[0]->setName(this->currentTrackElem->getName());
    268296}
    269297
     
    307335      return;
    308336    }
    309   trackElem->curveType = curveType;
     337  this->curveType = curveType;
    310338  switch (curveType)
    311339    {
     
    348376  if (trackElem->isFresh)
    349377    {
    350       this->setCurveType(BEZIERCURVE, trackElem);
     378      this->setCurveType(TMAN_DEFAULT_CURVETYPE, trackElem);
    351379      trackElem->isFresh = false;
    352380    }
     
    757785          TrackElement* tmpElem = this->findTrackElementByID(i);
    758786          PRINT(0)("--== TrackElement:%i ==--", tmpElem->ID);
    759           if(tmpElem->name)
    760             PRINT(0)("Name: %s::", tmpElem->name);
     787          if(tmpElem->getName())
     788            PRINT(0)("Name: %s::", tmpElem->getName());
    761789          if(tmpElem->isFresh)
    762790            PRINT(0)("  -- has not jet eddited in any way --\n");
Note: See TracChangeset for help on using the changeset viewer.