Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3302 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Dec 27, 2004, 9:31:52 PM (20 years ago)
Author:
patrick
Message:

orxonox/branches/parenting: implemented parenting and added to framework. sill got some problems with how to pass events through the new entity list (now part of the parenting-framework). changed to a more accurate way of coordinat-ing, the openGL coord-orientation. therefore the world is realy strange because it flies into the wrong direction.

Location:
orxonox/branches/parenting/src
Files:
2 added
20 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/parenting/src/Makefile.am

    r3276 r3302  
    2929                 list.cc \
    3030                 p_node.cc \
    31                  null_parent.cc
     31                 null_parent.cc \
     32                 base_object.cc
    3233
    3334noinst_HEADERS = ability.h \
     
    6465                 campaign.h \
    6566                 p_node.h \
    66                  null_parent.h
     67                 null_parent.h \
     68                 base_object.h
    6769
    6870
  • orxonox/branches/parenting/src/Makefile.in

    r3276 r3302  
    6161        environment.$(OBJEXT) object.$(OBJEXT) array.$(OBJEXT) \
    6262        material.$(OBJEXT) list.$(OBJEXT) p_node.$(OBJEXT) \
    63         null_parent.$(OBJEXT)
     63        null_parent.$(OBJEXT) base_object.$(OBJEXT)
    6464orxonox_OBJECTS = $(am_orxonox_OBJECTS)
    6565orxonox_LDADD = $(LDADD)
     
    6868am__depfiles_maybe = depfiles
    6969@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/array.Po \
    70 @AMDEP_TRUE@    ./$(DEPDIR)/base_entity.Po ./$(DEPDIR)/camera.Po \
     70@AMDEP_TRUE@    ./$(DEPDIR)/base_entity.Po \
     71@AMDEP_TRUE@    ./$(DEPDIR)/base_object.Po ./$(DEPDIR)/camera.Po \
    7172@AMDEP_TRUE@    ./$(DEPDIR)/campaign.Po ./$(DEPDIR)/collision.Po \
    7273@AMDEP_TRUE@    ./$(DEPDIR)/command_node.Po \
     
    220221                 list.cc \
    221222                 p_node.cc \
    222                  null_parent.cc
     223                 null_parent.cc \
     224                 base_object.cc
    223225
    224226noinst_HEADERS = ability.h \
     
    255257                 campaign.h \
    256258                 p_node.h \
    257                  null_parent.h
     259                 null_parent.h \
     260                 base_object.h
    258261
    259262EXTRA_DIST = orxonox.conf
     
    335338@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@
    336339@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_entity.Po@am__quote@
     340@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_object.Po@am__quote@
    337341@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/camera.Po@am__quote@
    338342@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/campaign.Po@am__quote@
  • orxonox/branches/parenting/src/camera.cc

    r3236 r3302  
    4545  this->actualPlace.r.y = 10.0;
    4646  this->actualPlace.r.z = -5.0;
     47
     48  this->setDrawable (false);
    4749}
    4850
     
    8385    case ELLIPTICAL:
    8486      {
     87        /*
    8588        //r = actual_place.r
    8689        Orxonox *orx = Orxonox::getInstance();
     
    9598              {
    9699                Vector *start = new Vector(0.0, 1.0, 0.0);
    97                 //r = /*actual_place.r*/ *start - plFocus.r;
    98100                r = *(new Vector(0.0, 5.0, 0.0));
    99101
     
    120122            //printf("vector r = %f, %f, %f\n",r.x, r.y, r.z );
    121123            rAbs = r.len();
    122             if(t < 30.0) /* FIXME!!*/
     124            if(t < 30)
    123125              {
    124126                ka = rAbs / deltaTime*deltaTime;
    125127              }
    126             /* this is the new length of the vector */
    127             //float len = ka * powf((deltaTime - t), 2);
    128            
    129             /* calc the rotation */
    130             /*
    131             Vector axis(0.0, 0.0, 1.0);
    132             if(t < 30.0)
    133               a0 = PI/4 - atanf(fabs(r.x) / fabs(r.y));
    134             printf("a0 = %f\n", a0);
    135             float angle = a0/deltaTime * (deltaTime - t);
    136             printf("angle is: %f\n", angle);
    137             Quaternion q(angle, axis);
    138             */
    139             //r = q.apply(r);
    140             //r = r * (len/r.len());
    141            
    142             //res->quatSlerp(from, to, t/deltaTime, res);
     128
    143129            res->quatSlerp(to, from, t/deltaTime, res);
    144130
    145131            Vector ursp(0.0, 0.0, 0.0);
    146             desiredPlace.r = /*plFocus.r -*/ ursp - res->apply(r);
     132            desiredPlace.r = ursp - res->apply(r);
    147133
    148134            printf("desired place is: %f, %f, %f\n", desiredPlace.r.x, desiredPlace.r.y, desiredPlace.r.z);
    149135            //plLastBPlace = *bound->get_placement();
     136           
    150137          }
     138      */
    151139      }
    152140      break;
    153141    case SMOTH_FOLLOW:
    154142      {
     143        /*
    155144        Placement *plBound = bound->getPlacement();
    156145        Location lcBound;
     
    160149            Vector vDirection(0.0, 0.0, 1.0);
    161150            vDirection = plBound->w.apply(vDirection);
    162             desiredPlace.r = (vDirection * ((lcBound.dist-10.0)/* / l*/)) + Vector(0,0,5.0);
     151            desiredPlace.r = (vDirection * ((lcBound.dist-10.0))) + Vector(0,0,5.0);
    163152          }
     153        */
    164154        break;
    165155      }
     
    167157    case STICKY:
    168158      {
     159        /*
    169160        if(bound != null)
    170161          {
     
    175166            desiredPlace.r = plBound->r - vDirection*10 + eclipticOffset;
    176167          }
     168        */
    177169        break;
    178170      }
     
    182174      if( bound != NULL && world != NULL )
    183175        {
    184           bound->getLookat (&lookat);
    185           world->calcCameraPos (&lookat, &desiredPlace);
     176          //bound->getLookat (&lookat);
     177          //bound->getAbsCoor ()
     178          //world->calcCameraPos (&lookat, &desiredPlace);
     179          //FIXME: camera should be made via relative coordinates
     180          Vector* cameraOffset = new Vector (-10, 0, 5);
     181          this->setRelCoor (cameraOffset);
    186182        }
    187183      else
    188184        {
     185          /*
    189186          desiredPlace.r = Vector (0,0,0);
    190187          desiredPlace.w = Quaternion ();
     188          */
    191189        }
    192190      break;
     
    237235  // rotation
    238236  float matrix[4][4];
    239   actualPlace.w.conjugate().matrix (matrix);
     237  //this->absDirection.conjugate().matrix (matrix);
    240238  /* orientation and */
    241   glMultMatrixf ((float*)matrix);
     239  //glMultMatrixf ((float*)matrix);
    242240  /*  translation */
    243   glTranslatef (-actualPlace.r.x, -actualPlace.r.y,- actualPlace.r.z);
     241  glTranslatef (this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z );
     242  //glTranslatef (-actualPlace.r.x, -actualPlace.r.y,- actualPlace.r.z);
    244243//Placement *plBound = bound->get_placement();
    245244
    246245  // ===== second camera control calculation option
    247   /*
    248    gluLookAt(actual_place.r.x, actual_place.r.y, actual_place.r.z,
    249               plBound->r.x, plBound->r.y, plBound->r.z,
    250               0.0, 0.0, 1.0);
    251   */
     246 
     247  gluLookAt(this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z,
     248            this->parent->getAbsCoor ().x, this->parent->getAbsCoor ().y, this->parent->getAbsCoor ().z,
     249            0.0, 0.0, 1.0);
     250 
    252251
    253252  glMatrixMode (GL_MODELVIEW);
  • orxonox/branches/parenting/src/camera.h

    r3236 r3302  
    88
    99#include "stdincl.h"
     10#include "world_entity.h"
    1011
    11 class WorldEntity;
     12
    1213class World;
    1314
     
    2324enum CAMERA_MODE {NORMAL, SMOTH_FOLLOW, STICKY, ELLIPTICAL};
    2425
    25 class Camera {
     26class Camera : public WorldEntity {
    2627 private:
    2728  WorldEntity* bound;           //!< the WorldEntity the Camera is bound to
  • orxonox/branches/parenting/src/environment.cc

    r3236 r3302  
    7070  glLoadIdentity();
    7171  float matrix[4][4];
     72
     73  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
     74  this->getAbsDir ().matrix (matrix);
    7275 
    73   glTranslatef(getPlacement()->r.x,getPlacement()->r.y,getPlacement()->r.z);
    74   getPlacement()->w.matrix (matrix);
     76
     77  //glTranslatef(getPlacement()->r.x,getPlacement()->r.y,getPlacement()->r.z);
     78  //getPlacement()->w.matrix (matrix);
    7579  glMultMatrixf ((float*)matrix);
    7680
  • orxonox/branches/parenting/src/null_parent.cc

    r3276 r3302  
    6060   worry, normaly...
    6161*/
    62 void NullParent::update (long timeStamp)
     62void NullParent::update (float timeStamp)
    6363{
    6464  this->absCoordinate = this->relCoordinate;
  • orxonox/branches/parenting/src/null_parent.h

    r3276 r3302  
    99
    1010#include "stdincl.h"
    11 #include "p_node.h"
     11#include "world_entity.h"
    1212
    1313
    14 class NullParent : public PNode {
     14class NullParent : public WorldEntity {
    1515
    1616 public:
     
    1919  ~NullParent ();
    2020
    21   virtual void update (long timeStamp);
     21  virtual void update (float timeStamp);
    2222
    2323};
  • orxonox/branches/parenting/src/p_node.cc

    r3277 r3302  
    180180      this->bRelCoorChanged = true;
    181181    }
    182 
    183   printf("PNode::shiftCoor() - relCoord: (%f, %f, %f)\n",
    184          this->relCoordinate.x,
    185          this->relCoordinate.y,
    186          this->relCoordinate.z);
    187182}
    188183
     
    342337   worry, normaly...
    343338*/
    344 void PNode::update (long timeStamp)
    345 {
    346      
     339void PNode::update (float timeStamp)
     340{
     341  printf ("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);
     342
    347343      if( this->mode == MOVEMENT || this->mode == ALL)
    348344        {
     
    399395
    400396
     397/*
     398  \brief tick
     399*/
     400void PNode::processTick (float dt)
     401{
     402  this->tick (dt);
     403  PNode* pn = this->children->enumerate();
     404  while( pn != NULL)
     405    {
     406      pn->processTick (dt);
     407      pn = this->children->nextElement();
     408    }
     409}
     410
     411
     412void PNode::tick (float dt)
     413{}
     414
     415
    401416void PNode::debug()
    402417{
     
    406421         this->absCoordinate.z);
    407422}
     423
     424
     425/*
     426  \brief set the name of the node
     427
     428  for debug purposes realy usefull, not used to work properly
     429*/
     430void PNode::setName (char* newName)
     431{
     432  this->objectName = newName;
     433}
     434
     435
     436/*
     437  \brief gets the name of the node
     438*/
     439char* PNode::getName ()
     440{
     441  return this->objectName;
     442}
  • orxonox/branches/parenting/src/p_node.h

    r3277 r3302  
    2929#define DEFAULT_MODE ALL
    3030
    31 class PNode {
     31class PNode : public BaseObject {
    3232
    3333 public:
     
    4545  Vector getRelCoor ();
    4646  void setRelCoor (Vector* relCoord);
     47  //void setRelCoor (Vector relCoord);
    4748  Vector getAbsCoor ();
    4849  void setAbsCoor (Vector* absCoord);
     50  //void setAbsCoor (Vector absCoord);
    4951  void shiftCoor (Vector* shift);
     52  //void shiftCoor (Vector shift);
    5053
    5154  Quaternion getRelDir ();
     
    6265  void parentDirChanged ();
    6366  void setMode (parentingMode mode);
    64   virtual void update (long timeStamp);
     67
     68  virtual void update (float timeStamp);
     69  void processTick (float dt);
     70  virtual void tick (float dt);
     71
     72  void setName (char* newName);
     73  char* getName ();
     74
    6575
    6676  void debug ();
    6777
    68   long timeStamp;   //! this the timeStamp of when the abs{Coordinat, Direction} has been calculated
     78  float timeStamp;   //! this the timeStamp of when the abs{Coordinat, Direction} has been calculated
     79  char* objectName;
    6980  bool bAbsCoorChanged;
    7081  bool bRelCoorChanged;
  • orxonox/branches/parenting/src/player.cc

    r3233 r3302  
    5454}
    5555
    56 Player::~Player()
     56Player::~Player ()
    5757{
    5858  delete this->obj;
    5959}
    6060
    61 void Player::postSpawn()
     61void Player::postSpawn ()
    6262{
    6363  travelSpeed = 15.0;
     
    6969}
    7070
    71 void Player::tick(float time)
     71void Player::tick (float time)
    7272{
    7373  // movement
    74   move (time);
     74  this->move (time);
    7575}
    7676
    77 void Player::hit(WorldEntity* weapon, Vector loc)
     77void Player::hit (WorldEntity* weapon, Vector loc)
    7878{
    7979}
    8080
    81 void Player::destroy()
     81void Player::destroy ()
    8282{
    8383}
    8484
    85 void Player::collide(WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags)
     85void Player::collide (WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags)
    8686{
    8787}
    8888
    89 void Player::command(Command* cmd)
     89void Player::command (Command* cmd)
    9090{
    9191  //printf("Player|recieved command [%s]\n", cmd->cmd);
     
    9797}
    9898
    99 void Player::draw()
     99void Player::draw ()
    100100{
    101101  glMatrixMode(GL_MODELVIEW);
     
    103103  float matrix[4][4];
    104104 
    105   glTranslatef(getPlacement()->r.x, getPlacement()->r.y, getPlacement()->r.z);
    106   getPlacement()->w.matrix (matrix);
     105  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
     106  //PN glTranslatef(getPlacement()->r.x, getPlacement()->r.y, getPlacement()->r.z);
     107  //getPlacement()->w.matrix (matrix);
     108  this->getAbsDir ().matrix (matrix);
    107109  glMultMatrixf((float*)matrix);
    108110 
    109111  glMatrixMode(GL_MODELVIEW);
    110   glRotatef(-90, 0,1,0);
     112  //glRotatef(-90, 0,1,0);
    111113  obj->draw();
    112114  // glCallList(objectList);
    113 
    114  
    115  
    116115}
    117116
     117
     118/*PN
    118119void Player::getLookat(Location* locbuf)
    119120{
     
    121122  //locbuf->dist += 5.0;
    122123}
     124*/
    123125
    124 void Player::leftWorld()
     126void Player::leftWorld ()
    125127{
    126128}
    127129
    128 void Player::move(float time)
     130void Player::move (float time)
    129131{
    130132  Vector accel(0.0, 0.0, 0.0);
    131133  /* FIXME: calculating the direction and orthDirection every timeSlice is redundant! save it somewhere */
    132   Placement *pos = getPlacement();
     134  //Placement *pos = getPlacement();
     135 
    133136  /* calculate the direction in which the craft is heading  */
    134   Vector direction(0.0, 0.0, 1.0);
    135   direction = pos->w.apply(direction);
    136   Vector orthDirection(0.0, 0.0, 1.0);
    137   orthDirection = orthDirection.cross(direction);
     137  Vector direction (1.0, 0.0, 0.0);
     138  //direction = this->absDirection.apply (direction);
     139  Vector orthDirection (0.0, 0.0, 1.0);
     140  //orthDirection = orthDirection.cross (direction);
    138141
    139142  if( bUp) { accel = accel+(direction*acceleration); }
     
    144147  if( bDescend) {/* FIXME */} /* \todo up and down player movement */
    145148
    146   Location* l = getLocation();
     149  //Location* l = getLocation();
    147150 
    148151  // r(t) = r(0) + v(0)*t + 1/2*a*t^2
     
    152155
    153156  /* this the base-speed of the player: determines how fast and how the player follows the track*/
    154   l->dist = l->dist + travelSpeed * time;
    155 
     157  //l->dist = l->dist + travelSpeed * time;
     158 
     159  Vector* shift = new Vector (this->travelSpeed * time, 0, 0);
     160  this->shiftCoor (shift);
     161 
    156162  /* this updates the player position on the track - user interaction */
    157   l->pos = l->pos + accel*time;
     163  //l->pos = l->pos + accel*time;
     164  Vector move = accel * time;
     165  this->shiftCoor (&move);
    158166}
  • orxonox/branches/parenting/src/player.h

    r3236 r3302  
    2727 
    2828  virtual void draw();
    29   virtual void getLookat(Location* locbuf);
     29  // virtual void getLookat(Location* locbuf);
    3030 
    3131  virtual void leftWorld();
  • orxonox/branches/parenting/src/proto_class.cc

    r3245 r3302  
    2828   \todo this constructor is not jet implemented - do it
    2929*/
    30 ProtoClass::ProtoClass () {}
     30ProtoClass::ProtoClass ()
     31{
     32   this->setClassName ("ProtoClass");
     33}
    3134
    3235
  • orxonox/branches/parenting/src/proto_class.h

    r3246 r3302  
    1212/*class Test;*/ /* forward definition of class Test (without including it here!)*/
    1313
    14 class ProtoClass {
     14class ProtoClass : public BaseObject {
    1515
    1616 public:
  • orxonox/branches/parenting/src/stdincl.h

    r3249 r3302  
    3939#include "orxonox.h"
    4040#include "data_tank.h"
     41#include "base_object.h"
    4142
    4243#endif /* _STDINCL_H */
  • orxonox/branches/parenting/src/story_entity.h

    r3224 r3302  
    1212
    1313//! A class that represents something to play in orxonox. it is a container for worlds, movies, mission briefings, etc...
    14 class StoryEntity {
     14class StoryEntity : public BaseObject {
    1515
    1616 public:
  • orxonox/branches/parenting/src/track.cc

    r3232 r3302  
    2929  this->end = NULL;
    3030  this->nextID = 0;
     31  this->setClassName ("Track");
    3132}
    3233
     
    4445  this->end = finish;
    4546  this->nextID = next;
     47  this->setClassName ("Track");
    4648}
    4749
  • orxonox/branches/parenting/src/track.h

    r3232 r3302  
    1414   To create special levels with special camera movement, rules or whatever, derive from this base class.
    1515*/
    16 class Track
     16class Track : public BaseObject
    1717{
    1818 private:
  • orxonox/branches/parenting/src/world.cc

    r3277 r3302  
    3636World::World (char* name)
    3737{
     38  this->setClassName ("World");
    3839  this->worldName = name;
    3940  this->debugWorldNr = -1;
     
    132133          {
    133134            this->nullParent = new NullParent ();
     135            this->nullParent->setName ("NullParent");
    134136
    135137            // create some path nodes
     
    153155            // create a player
    154156            WorldEntity* myPlayer = new Player();
     157            myPlayer->setName ("player");
    155158            this->spawn(myPlayer);
    156159            this->localPlayer = myPlayer;           
     
    162165            // bind camera
    163166            this->localCamera = new Camera(this);
    164             this->getCamera()->bind (myPlayer);
     167            this->localCamera->setName ("camera");
     168            this->getCamera()->bind (myPlayer);
     169            this->localPlayer->addChild (this->localCamera);
    165170           
    166171            /*
     
    449454  WorldEntity* entity;
    450455 
     456  ((WorldEntity*)this->nullParent)->processDraw ();
     457
     458  /*
    451459  entity = this->entities->enumerate();
    452460  while( entity != NULL )
     
    455463      entity = this->entities->nextElement();
    456464    }
    457  
     465  */
    458466 
    459467  // draw debug coord system
     
    473481void World::update ()
    474482{
     483  /*
    475484  //List<WorldEntity> *l;
    476485  WorldEntity* entity;
     
    491500          t = loc->part;
    492501         
    493           /* check if entity has still a legal track-id */
    494502          if( t >= tracklen )
    495503            {
     
    514522      else
    515523        {
    516           /* \todo: implement check whether this particular free entity
    517              is out of the game area
    518              \todo: call function to notify the entity that it left
    519              the game area
    520           */
    521524        }
    522525     
    523526      entity = entities->nextElement();
    524527    }
    525  
     528  */ 
    526529}
    527530
     
    536539  float seconds = deltaT / 1000.0;
    537540 
     541  this->nullParent->update (seconds);
     542  this->nullParent->processTick (seconds);
     543
    538544  entity = entities->enumerate();
    539545  while( entity != NULL)
     
    656662void World::mainLoop()
    657663{
    658   this->lastFrame = SDL_GetTicks();
     664  this->lastFrame = SDL_GetTicks ();
    659665  printf("World::mainLoop() - Entering main loop\n");
    660666  while( !this->bQuitOrxonox && !this->bQuitCurrentGame) /* \todo implement pause */
    661667    {
    662668      // Network
    663       synchronize();
     669      this->synchronize ();
    664670      // Process input
    665       handleInput();
     671      this->handleInput ();
    666672      if( this->bQuitCurrentGame || this->bQuitOrxonox)
    667673        {
     
    670676        }
    671677      // Process time
    672       timeSlice();
     678      this->timeSlice ();
    673679      // Process collision
    674       collision();
     680      this->collision ();
    675681      // Draw
    676       display();
    677  
    678       for(int i = 0; i < 10000000; i++) {}
     682      this->display ();
     683 
     684      for( int i = 0; i < 10000000; i++) {}
    679685    }
    680686  printf("World::mainLoop() - Exiting the main loop\n");
     
    792798    this->nullParent->addChild (entity);
    793799
     800  /*
    794801  entities->add (entity);
    795802  zeroloc.dist = 0;
     
    803810      this->track[loc->part].mapCoords( loc, entity->getPlacement());
    804811    }
     812  */
    805813  entity->postSpawn ();
    806814}
     
    817825    this->nullParent->addChild (entity);
    818826
    819   Location zeroLoc;
     827  //Location zeroLoc;
    820828  WorldEntity* owner;
    821829  this->entities->add (entity);
     830  /*
    822831  if( loc == NULL)
    823832    {
     
    828837      loc = &zeroLoc;
    829838    }
    830   entity->init (loc, owner);
     839  */
     840  //entity->init (loc, owner);
     841  /*
    831842  if (entity->bFree)
    832843    {
    833844      this->track[loc->part].mapCoords( loc, entity->getPlacement());
    834845    }
     846  */
    835847  entity->postSpawn ();
    836848  //return entity;
     
    848860    this->nullParent->addChild (entity);
    849861
     862  /*
    850863  Placement zeroPlc;
    851864  WorldEntity* owner;
     
    856869      plc = &zeroPlc;
    857870    }
     871  */
    858872  this->entities->add (entity);
    859   entity->init (plc, owner);
     873  //entity->init (plc, owner);
    860874  entity->postSpawn ();
    861875  //return entity;
  • orxonox/branches/parenting/src/world_entity.cc

    r3245 r3302  
    3636WorldEntity::WorldEntity (bool isFree) : bFree(isFree)
    3737{
     38  this->setClassName ("WorldEntity");
    3839  this->bDraw = true;
    3940  collisioncluster = NULL;
     
    5354   \return a pointer to location
    5455*/
     56/*PN
    5557Location* WorldEntity::getLocation ()
    5658{
    5759  return &loc;
    5860}
     61*/
    5962
    6063/**
     
    6265   \return a pointer to placement
    6366*/
     67 /*PN
    6468Placement* WorldEntity::getPlacement ()
    6569{
    6670  return &place;
    6771}
    68 
     72 */
    6973/**
    7074   \brief query whether the WorldEntity in question is free
     
    8993}
    9094
     95
    9196/**
    9297   \brief this method is called every frame
     
    99104}
    100105
     106
     107/**
     108    \brief process draw function
     109*/
     110void WorldEntity::processDraw ()
     111{
     112  this->draw ();
     113  PNode* pn = this->children->enumerate ();
     114  while( pn != NULL)
     115    {
     116      ((WorldEntity*)pn)->processDraw ();
     117      pn = this->children->nextElement();
     118    }
     119}
     120
     121
     122void WorldEntity::setDrawable (bool bDraw)
     123{
     124  this->bDraw = bDraw;
     125}
     126
     127
    101128/**
    102129   \brief the entity is drawn onto the screen with this function
     
    105132*/
    106133void WorldEntity::draw()
    107 {
    108 }
     134{}
    109135
    110136/**
     
    140166void WorldEntity::init( Location* spawnloc, WorldEntity* spawnowner)
    141167{
    142   loc = *spawnloc;
    143   owner = spawnowner;
     168  //  loc = *spawnloc;
     169  //owner = spawnowner;
    144170}
    145171
     
    149175void WorldEntity::init( Placement* spawnplc, WorldEntity* spawnowner)
    150176{
    151   place = *spawnplc;
    152   owner = spawnowner;
     177  //place = *spawnplc;
     178  //owner = spawnowner;
    153179}
    154180
     
    181207   to look at the location you return with this.
    182208*/
     209/*PN
    183210void WorldEntity::getLookat (Location* locbuf)
    184211{
    185212}
     213*/
    186214
    187215/**
  • orxonox/branches/parenting/src/world_entity.h

    r3277 r3302  
    2222 
    2323  //PNode* pNode;
    24   Location* getLocation ();
    25   Placement* getPlacement ();
     24  //PN Location* getLocation ();
     25  //PN Placement* getPlacement ();
    2626  void setCollision (CollisionCluster* newhull);
    2727 
     
    3737  virtual void collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags);
    3838  virtual void command (Command* cmd);
    39  
     39
     40  void processDraw ();
    4041  virtual void draw ();
    41   virtual void getLookat (Location* locbuf);
     42  void setDrawable (bool bDraw);
     43  //PN virtual void getLookat (Location* locbuf);
    4244 
    4345  virtual void leftWorld ();
     
    5052  WorldEntity* owner;
    5153  CollisionCluster* collisioncluster;
    52   Placement place;
    53   Location loc;
     54  //PN Placement place;
     55  //PN Location loc;
    5456 
    5557  void init( Location* spawnloc, WorldEntity* spawnowner);
Note: See TracChangeset for help on using the changeset viewer.