Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 25, 2007, 3:05:01 AM (17 years ago)
Author:
patrick
Message:

merged playability. but got strange bug

Location:
branches/playability.new
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/playability.new

    • Property svn:ignore
      •  

        old new  
        1010autom4te.cache
        1111aclocal.m4
         12tags
         13test.bmp
         14config.sub
         15config.guess
         16OrxonoxPlayability.kdevses
         17OrxonoxPlayability.kdevelop.pcs
  • branches/playability.new/src/world_entities/world_entity.cc

    r10314 r10362  
    3232
    3333#include "util/loading/load_param.h"
     34#include "loading/load_param_xml.h"
     35#include "util/loading/factory.h"
     36
    3437#include "obb_tree.h"
    3538
    3639#include "elements/glgui_energywidget.h"
     40#include "elements/glgui_energywidgetvertical.h"
    3741
    3842#include "state.h"
     
    4448#include "kill.h"
    4549#include "debug.h"
     50
     51#include "track/track.h"
    4652
    4753#include "projectiles/projectile.h"
     
    8692  this->_bOnGround = false;
    8793
     94  // Track of this entity
     95  this->entityTrack = NULL;
     96
    8897  // registering default reactions:
    8998  this->subscribeReaction(CoRe::CREngine::CR_OBJECT_DAMAGE, Projectile::staticClassID());
     
    148157  .describe("the fileName of the object information file (optional)");
    149158
     159  // Entity Attributes
    150160  LoadParam(root, "maxHealth", this, WorldEntity, setHealthMax)
    151161  .describe("The Maximum health that can be loaded onto this entity")
     
    157167
    158168  LoadParam(root, "list", this, WorldEntity, toListS);
     169
     170
     171  // Track
     172  LoadParamXML(root, "Track", this, WorldEntity, addTrack)
     173   .describe("creates and adds a track to this WorldEntity");
     174}
     175
     176
     177/**
     178 * this functions adds a track to this workd entity. This can be usefull, if you like this WE to follow a some waypoints.
     179 * here the track is created and further initializing left for the Track itself
     180 */
     181void WorldEntity::addTrack(const TiXmlElement* root)
     182{
     183  // The problem we have is most likely here. The track should be constructed WITH the XML-Code
     184  this->entityTrack = new Track(root);
     185  this->setParent(this->entityTrack->getTrackNode());
     186  this->entityTrack->getTrackNode()->setParentMode(PNODE_ALL);
     187  /*LOAD_PARAM_START_CYCLE(root, element);
     188  {
     189    PRINTF(4)("element is: %s\n", element->Value());
     190    Factory::fabricate(element);
     191  }
     192  LOAD_PARAM_END_CYCLE(element);*/
     193 
     194
    159195}
    160196
     
    613649*/
    614650void WorldEntity::tick(float time)
    615 {}
     651{
     652}
    616653
    617654
     
    652689      this->models[0]->draw();
    653690    }
     691   
     692    //if (this->entityTrack)
     693       //this->entityTrack->drawGraph(0.02);
    654694
    655695    //     if( this->aabbNode != NULL)
     
    721761  if (this->healthWidget == NULL)
    722762  {
    723     this->healthWidget = new OrxGui::GLGuiEnergyWidget();
    724     this->healthWidget->setDisplayedName(std::string(this->getClassName()) + " Energy:");
    725     this->healthWidget->setSize2D(30,400);
    726     this->healthWidget->setAbsCoor2D(10,100);
     763    this->healthWidget = new OrxGui::GLGuiEnergyWidgetVertical();
     764    //this->healthWidget->setDisplayedName("Health");
     765    //this->healthWidget->setSize2D(100,20);
     766    //this->healthWidget->setAbsCoor2D(100,200);
    727767
    728768    this->updateHealthWidget();
     
    773813void WorldEntity::hit(float damage, WorldEntity* killer)
    774814{
     815
    775816  this->decreaseHealth(damage);
    776817
Note: See TracChangeset for help on using the changeset viewer.