Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3306 in orxonox.OLD for orxonox/branches/parenting


Ignore:
Timestamp:
Dec 30, 2004, 12:32:43 AM (20 years ago)
Author:
patrick
Message:

orxonox/branches/parenting: modified function passing routines - now having two lists: parenting list (tree) and entity list (array), that coexist - this is the only possibility to keep oversight.

Location:
orxonox/branches/parenting/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/parenting/src/null_parent.cc

    r3302 r3306  
    6464  this->absCoordinate = this->relCoordinate;
    6565  this->absDirection = parent->getAbsDir () * this->relDirection;
    66    
    6766 
    6867  PNode* pn = this->children->enumerate ();
  • orxonox/branches/parenting/src/world.cc

    r3302 r3306  
    257257 
    258258  //Berechnung von normalen Vektoren
    259 
     259 
    260260  for(int i=1;i<sizeX-2;i+=1)
    261261    for(int j=1;j<sizeY-2 ;j+=1)
     
    454454  WorldEntity* entity;
    455455 
    456   ((WorldEntity*)this->nullParent)->processDraw ();
    457 
    458   /*
     456  //((WorldEntity*)this->nullParent)->processDraw ();
     457
     458 
    459459  entity = this->entities->enumerate();
    460460  while( entity != NULL )
     
    463463      entity = this->entities->nextElement();
    464464    }
    465   */
     465 
    466466 
    467467  // draw debug coord system
     
    540540 
    541541  this->nullParent->update (seconds);
    542   this->nullParent->processTick (seconds);
     542  //this->nullParent->processTick (seconds);
    543543
    544544  entity = entities->enumerate();
     
    791791void World::spawn(WorldEntity* entity)
    792792{
    793   Location zeroloc;
    794   Location* loc = NULL;
    795   WorldEntity* owner;
    796 
    797   if( this->nullParent != NULL)
     793  if( this->nullParent != NULL && entity->parent == NULL)
    798794    this->nullParent->addChild (entity);
    799795
    800   /*
    801   entities->add (entity);
    802   zeroloc.dist = 0;
    803   zeroloc.part = 0;
    804   zeroloc.pos = Vector();
    805   zeroloc.rot = Quaternion();
    806   loc = &zeroloc;
    807   entity->init (loc, owner);
    808   if (entity->bFree)
    809     {
    810       this->track[loc->part].mapCoords( loc, entity->getPlacement());
    811     }
    812   */
     796  this->entities->add (entity);
     797
    813798  entity->postSpawn ();
    814799}
     
    820805   \param location where to add
    821806*/
    822 void World::spawn(WorldEntity* entity, Location* loc)
    823 {
    824   if( this->nullParent != NULL)
     807void World::spawn(WorldEntity* entity, Vector* absCoor, Quaternion* absDir)
     808{
     809  entity->setAbsCoor (absCoor);
     810  entity->setAbsDir (absDir);
     811 
     812  if( this->nullParent != NULL && entity->parent == NULL)
    825813    this->nullParent->addChild (entity);
    826814
    827   //Location zeroLoc;
    828   WorldEntity* owner;
    829815  this->entities->add (entity);
    830   /*
    831   if( loc == NULL)
    832     {
    833       zeroLoc.dist = 0;
    834       zeroLoc.part = 0;
    835       zeroLoc.pos = Vector();
    836       zeroLoc.rot = Quaternion();
    837       loc = &zeroLoc;
    838     }
    839   */
    840   //entity->init (loc, owner);
    841   /*
    842   if (entity->bFree)
    843     {
    844       this->track[loc->part].mapCoords( loc, entity->getPlacement());
    845     }
    846   */
     816
    847817  entity->postSpawn ();
    848   //return entity;
    849 }
    850 
    851 
    852 /**
    853    \brief add and spawn a new entity to this world
    854    \param entity to be added
    855    \param place where to be added
    856 */
    857 void World::spawn(WorldEntity* entity, Placement* plc)
    858 {
    859   if( this->nullParent != NULL)
    860     this->nullParent->addChild (entity);
    861 
    862   /*
    863   Placement zeroPlc;
    864   WorldEntity* owner;
    865   if( plc == NULL)
    866     {
    867       zeroPlc.r = Vector();
    868       zeroPlc.w = Quaternion();
    869       plc = &zeroPlc;
    870     }
    871   */
    872   this->entities->add (entity);
    873   //entity->init (plc, owner);
    874   entity->postSpawn ();
    875   //return entity;
    876 }
     818}
     819
    877820
    878821
  • orxonox/branches/parenting/src/world.h

    r3276 r3306  
    5454
    5555  void spawn (WorldEntity* entity);
    56   void spawn (WorldEntity* entity, Location* loc);
    57   void spawn (WorldEntity* entity, Placement* plc);
     56  void spawn (WorldEntity* entity, Vector* absCoor, Quaternion* absDir);
    5857
    5958  tList<WorldEntity>* entities;
Note: See TracChangeset for help on using the changeset viewer.