Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3551 in orxonox.OLD


Ignore:
Timestamp:
Mar 14, 2005, 11:46:50 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: renamed all timing functions to tick() - cleanede up world

Location:
orxonox/trunk/src
Files:
8 edited

Legend:

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

    r3550 r3551  
    6363   as smooth camera movement or swaying).
    6464*/
    65 void Camera::timeSlice (Uint32 deltaT)
     65void Camera::tick (Uint32 deltaT)
    6666{
    6767  if( this->t <= deltaTime)
  • orxonox/trunk/src/camera.h

    r3544 r3551  
    5656  virtual ~Camera ();
    5757 
    58   void timeSlice (Uint32 deltaT);
     58  void tick (Uint32 deltaT);
    5959  void apply ();
    6060  void bind (WorldEntity* entity);
  • orxonox/trunk/src/lib/coord/null_parent.cc

    r3545 r3551  
    7272   worry, normaly...
    7373*/
    74 void NullParent::update (float timeStamp)
     74void NullParent::update ()
    7575{
    7676
     
    8787      if( this->bRelDirChanged || this->bAbsDirChanged)
    8888        pn->parentDirChanged ();
    89       pn->update (timeStamp);
     89      pn->update ();
    9090      pn = this->children->nextElement ();
    9191    }
  • orxonox/trunk/src/lib/coord/null_parent.h

    r3544 r3551  
    2020  static NullParent* singletonRef;
    2121
    22   virtual void update (float timeStamp);
     22  virtual void update ();
    2323
    2424 private:
  • orxonox/trunk/src/lib/coord/p_node.cc

    r3547 r3551  
    1313   ### File Specific:
    1414   main-programmer: Patrick Boenzli
    15    co-programmer: ...
    16 
    17    \todo Null-Parent => center of the coord system - singleton
     15   co-programmer:
     16
    1817   \todo Smooth-Parent: delay, speed
    19    \todo destroy the stuff again, delete...
    2018*/
    2119
     
    109107  delete &this->absDirection;
    110108  */
    111   this->parent = NULL;
     109  //this->parent = NULL;
    112110  /* there is currently a problem with cleaning up - fix*/
    113111
     112 
    114113  PNode* pn = this->children->enumerate();
    115114  while( pn != NULL)
     
    117116      pn = this->children->nextElement();
    118117      delete pn;
    119     }
     118    }
     119   
    120120  /* this deletes all children in the list */
    121121  delete this->children;
     
    429429   worry, normaly...
    430430*/
    431 void PNode::update (float timeStamp)
     431void PNode::update ()
    432432{
    433433  PRINTF(2)("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);
     
    493493      if( this->bRelDirChanged || this->bAbsDirChanged)
    494494        pn->parentDirChanged ();
    495       pn->update(timeStamp);
     495      pn->update();
    496496      pn = this->children->nextElement();
    497497    }
     
    511511void PNode::processTick (float dt)
    512512{
    513   this->tick (dt);
     513  //this->tick (dt);
    514514  PNode* pn = this->children->enumerate();
    515515  while( pn != NULL)
     
    520520}
    521521
    522 /**
    523    \param dt time to tick
    524 */
    525 void PNode::tick (float dt)
    526 {}
    527522
    528523/**
  • orxonox/trunk/src/lib/coord/p_node.h

    r3544 r3551  
    7474  parentingMode getMode();
    7575
    76   virtual void update (float timeStamp);
     76  virtual void update ();
    7777  void processTick (float dt);
    78   virtual void tick (float dt);
    7978
    8079  void setName (char* newName);
  • orxonox/trunk/src/story_entities/world.cc

    r3548 r3551  
    285285
    286286            break;
    287 
    288 
    289287          }
    290288        default:
     
    632630  p4->debug ();
    633631 
    634   p1->update (1);
     632  p1->update ();
    635633
    636634  printf ("World::debug() - update\n");
     
    641639
    642640  p2->shiftCoor (new Vector(-1, -1, -1));
    643   p1->update (2);
     641  p1->update ();
    644642
    645643  p1->debug ();
     
    651649
    652650
    653  p1->update (2);
     651 p1->update ();
    654652
    655653  p1->debug ();
     
    696694          break;
    697695      // Process time
    698       this->timeSlice ();
     696      this->tick ();
     697      // Update the state
     698      this->update ();     
    699699      // Process collision
    700700      this->collide ();
     
    743743   a heart-beat.
    744744*/
    745 void World::timeSlice ()
     745void World::tick ()
    746746{
    747747  Uint32 currentFrame = SDL_GetTicks();
     
    778778     
    779779      /* update tick the rest */
    780       this->localCamera->timeSlice(dt);
     780      this->localCamera->tick(dt);
    781781      this->trackManager->tick(dt);
    782       this->nullParent->update (seconds);
    783782    }
    784783  this->lastFrame = currentFrame;
     784}
     785
     786
     787/**
     788   \brief this function gives the world a consistant state
     789
     790   after ticking (updating the world state) this will give a constistant
     791   state to the whole system.
     792*/
     793void World::update()
     794{
     795  this->nullParent->update ();
    785796}
    786797
     
    814825void World::spawn(WorldEntity* entity)
    815826{
    816   this->nullParent->addChild (entity);
    817827  this->entities->add (entity);
    818828  entity->postSpawn ();
     
    828838void World::spawn(WorldEntity* entity, Vector* absCoor, Quaternion* absDir)
    829839{
    830   this->nullParent->addChild (entity);
    831840  this->entities->add (entity);
    832841
     
    849858                  parentingMode mode)
    850859{
    851 
     860  this->nullParent = NullParent::getInstance();
    852861  if( parentNode != NULL)
    853862    {
  • orxonox/trunk/src/story_entities/world.h

    r3526 r3551  
    8484  void synchronize ();
    8585  void handleInput ();
    86   void timeSlice ();
     86  void tick ();
     87  void update ();
    8788  void collide ();
    8889  void draw ();
Note: See TracChangeset for help on using the changeset viewer.