Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Dec 25, 2004, 1:44:31 AM (20 years ago)
Author:
patrick
Message:

orxonox/branches/parenting: worldentity is now derived from parentnode, pNode added into the world class, not yet used activly.. this will be a mess…

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

Legend:

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

    r3276 r3277  
    6969PNode::~PNode ()
    7070{
    71   this->children->destroy();
    72   delete this->children;
     71  /*
     72  delete &this->children;
     73  delete &this->relCoordinate;
     74  delete &this->absCoordinate;
     75  delete &this->relDirection;
     76  delete &this->absDirection;
     77  */
     78  this->parent = NULL;
     79  /* there is currently a problem with cleaning up - fix*/
     80}
     81
     82
     83/**
     84   \brief deletes the hole pnode tree
     85
     86   cleans up all pnodes
     87*/
     88void PNode::destroy ()
     89{
     90  PNode* pn = this->children->enumerate();
     91  while( pn != NULL)
     92    {
     93      pn->destroy ();
     94      pn = this->children->nextElement();
     95    }
     96  this->children->destroy ();
    7397}
    7498
  • orxonox/branches/parenting/src/p_node.h

    r3276 r3277  
    3434  PNode ();
    3535  PNode (Vector* absCoordinate, PNode* pNode);
    36   ~PNode ();
     36  virtual ~PNode ();
     37
     38  void destroy ();
    3739
    3840  PNode* parent; //! a pointer to the parent node
  • orxonox/branches/parenting/src/world.cc

    r3276 r3277  
    6767  this->entities->destroy();
    6868
     69  /* FIX the parent list has to be cleared - not possible if we got the old list also*/
     70  //this->nullParent->destroy ();
     71
    6972  delete this->entities;
    7073  delete this->localCamera;
     
    8285
    8386  /* this is only for test purposes */
    84   //this->debug ();
     87  this->debug ();
    8588}
    8689
     
    128131        case DEBUG_WORLD_0:
    129132          {
     133            this->nullParent = new NullParent ();
     134
    130135            // create some path nodes
    131136            this->pathnodes = new Vector[6];
     
    146151            // !\todo old track-system has to be removed
    147152
    148             //this->nullParent = new NullParent ();
    149 
    150153            // create a player
    151154            WorldEntity* myPlayer = new Player();
     
    160163            this->localCamera = new Camera(this);
    161164            this->getCamera()->bind (myPlayer);
    162 
     165           
     166            /*
    163167            Placement* plc = new Placement;
    164168            plc->r = Vector(100, 10, 10);
     
    166170            WorldEntity* env = new Environment();
    167171            this->spawn(env, plc);
     172            */
    168173
    169174            break;
     
    171176        case DEBUG_WORLD_1:
    172177          {
     178            this->nullParent = new NullParent ();
     179
    173180            // create some path nodes
    174181            this->pathnodes = new Vector[6];
     
    622629  p3->debug ();
    623630  p4->debug ();
     631
     632  p1->destroy ();
     633 
     634 
    624635  /*
    625636  WorldEntity* entity;
     
    778789  WorldEntity* owner;
    779790
     791  if( this->nullParent != NULL)
     792    this->nullParent->addChild (entity);
     793
    780794  entities->add (entity);
    781795  zeroloc.dist = 0;
     
    800814void World::spawn(WorldEntity* entity, Location* loc)
    801815{
     816  if( this->nullParent != NULL)
     817    this->nullParent->addChild (entity);
     818
    802819  Location zeroLoc;
    803820  WorldEntity* owner;
     
    828845void World::spawn(WorldEntity* entity, Placement* plc)
    829846{
     847  if( this->nullParent != NULL)
     848    this->nullParent->addChild (entity);
     849
    830850  Placement zeroPlc;
    831851  WorldEntity* owner;
  • orxonox/branches/parenting/src/world_entity.h

    r3229 r3277  
    88
    99#include "stdincl.h"
     10#include "p_node.h"
    1011
    1112class CollisionCluster;
    1213
    1314//! Basic class from which all interactive stuff in the world is derived from
    14 class WorldEntity
     15class WorldEntity : public PNode
    1516{       
    1617  friend class World;
    17  
     18
    1819 public:
    1920  WorldEntity (bool isFree = false);
    2021  virtual ~WorldEntity ();
    2122 
     23  //PNode* pNode;
    2224  Location* getLocation ();
    2325  Placement* getPlacement ();
Note: See TracChangeset for help on using the changeset viewer.