Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4332 in orxonox.OLD


Ignore:
Timestamp:
May 27, 2005, 7:14:55 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/physics: merged the trunk back to the physics-branche
merged with command:
svn merge -r 4301:HEAD trunk/ branches/physics/
little conflict in particle-system resolved easily

Location:
orxonox/branches/physics/src
Files:
2 deleted
39 edited
11 copied

Legend:

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

    r4293 r4332  
    8181                 lib/coord/null_parent.cc \
    8282                 lib/coord/helper_parent.cc \
     83                 lib/coord/pilot_node.cc \
    8384                 lib/graphics/graphics_engine.cc \
    8485                 lib/graphics/light.cc \
     
    9495                 lib/graphics/particles/particle_system.cc \
    9596                 lib/graphics/particles/particle_emitter.cc \
    96                  lib/lang/base_entity.cc \
    9797                 lib/lang/base_object.cc \
    9898                 lib/util/ini_parser.cc \
     
    107107                 defs/keynames.h \
    108108                 command_node.h \
     109                 action_listener.h \
    109110                 defs/message_structures.h \
    110111                 util/loading/game_loader.h \
     
    151152                 lib/coord/null_parent.h \
    152153                 lib/coord/helper_parent.h \
     154                 lib/coord/pilot_node.h \
    153155                 lib/graphics/graphics_engine.h \
    154156                 lib/graphics/light.h \
     
    165167                 lib/graphics/particles/particle_system.h \
    166168                 lib/graphics/particles/particle_emitter.h \
    167                  lib/lang/base_entity.h \
    168169                 lib/lang/base_object.h \
    169170                 util/common/list.h \
  • orxonox/branches/physics/src/Makefile.in

    r4293 r4332  
    6868        test_bullet.$(OBJEXT) test_entity.$(OBJEXT) p_node.$(OBJEXT) \
    6969        null_parent.$(OBJEXT) helper_parent.$(OBJEXT) \
    70         graphics_engine.$(OBJEXT) light.$(OBJEXT) \
     70        pilot_node.$(OBJEXT) graphics_engine.$(OBJEXT) light.$(OBJEXT) \
    7171        text_engine.$(OBJEXT) array.$(OBJEXT) objModel.$(OBJEXT) \
    7272        md2Model.$(OBJEXT) primitive_model.$(OBJEXT) model.$(OBJEXT) \
    7373        material.$(OBJEXT) texture.$(OBJEXT) particle_engine.$(OBJEXT) \
    7474        particle_system.$(OBJEXT) particle_emitter.$(OBJEXT) \
    75         base_entity.$(OBJEXT) base_object.$(OBJEXT) \
    76         ini_parser.$(OBJEXT) substring.$(OBJEXT) vector.$(OBJEXT) \
    77         curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT) \
     75        base_object.$(OBJEXT) ini_parser.$(OBJEXT) substring.$(OBJEXT) \
     76        vector.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT) \
    7877        benchmark.$(OBJEXT)
    7978orxonox_OBJECTS = $(am_orxonox_OBJECTS)
     
    8584@AMDEP_TRUE@    ./$(DEPDIR)/animation3d.Po \
    8685@AMDEP_TRUE@    ./$(DEPDIR)/animation_player.Po \
    87 @AMDEP_TRUE@    ./$(DEPDIR)/array.Po ./$(DEPDIR)/base_entity.Po \
    88 @AMDEP_TRUE@    ./$(DEPDIR)/base_object.Po \
     86@AMDEP_TRUE@    ./$(DEPDIR)/array.Po ./$(DEPDIR)/base_object.Po \
    8987@AMDEP_TRUE@    ./$(DEPDIR)/benchmark.Po ./$(DEPDIR)/camera.Po \
    9088@AMDEP_TRUE@    ./$(DEPDIR)/campaign.Po \
     
    107105@AMDEP_TRUE@    ./$(DEPDIR)/particle_engine.Po \
    108106@AMDEP_TRUE@    ./$(DEPDIR)/particle_system.Po \
    109 @AMDEP_TRUE@    ./$(DEPDIR)/player.Po \
     107@AMDEP_TRUE@    ./$(DEPDIR)/pilot_node.Po ./$(DEPDIR)/player.Po \
    110108@AMDEP_TRUE@    ./$(DEPDIR)/primitive_model.Po \
    111109@AMDEP_TRUE@    ./$(DEPDIR)/projectile.Po \
     
    295293                 lib/coord/null_parent.cc \
    296294                 lib/coord/helper_parent.cc \
     295                 lib/coord/pilot_node.cc \
    297296                 lib/graphics/graphics_engine.cc \
    298297                 lib/graphics/light.cc \
     
    308307                 lib/graphics/particles/particle_system.cc \
    309308                 lib/graphics/particles/particle_emitter.cc \
    310                  lib/lang/base_entity.cc \
    311309                 lib/lang/base_object.cc \
    312310                 lib/util/ini_parser.cc \
     
    321319                 defs/keynames.h \
    322320                 command_node.h \
     321                 action_listener.h \
    323322                 defs/message_structures.h \
    324323                 util/loading/game_loader.h \
     
    365364                 lib/coord/null_parent.h \
    366365                 lib/coord/helper_parent.h \
     366                 lib/coord/pilot_node.h \
    367367                 lib/graphics/graphics_engine.h \
    368368                 lib/graphics/light.h \
     
    379379                 lib/graphics/particles/particle_system.h \
    380380                 lib/graphics/particles/particle_emitter.h \
    381                  lib/lang/base_entity.h \
    382381                 lib/lang/base_object.h \
    383382                 util/common/list.h \
     
    476475@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/animation_player.Po@am__quote@
    477476@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@
    478 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_entity.Po@am__quote@
    479477@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_object.Po@am__quote@
    480478@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/benchmark.Po@am__quote@
     
    507505@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/particle_engine.Po@am__quote@
    508506@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/particle_system.Po@am__quote@
     507@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot_node.Po@am__quote@
    509508@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/player.Po@am__quote@
    510509@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/primitive_model.Po@am__quote@
     
    10901089@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o helper_parent.obj `if test -f 'lib/coord/helper_parent.cc'; then $(CYGPATH_W) 'lib/coord/helper_parent.cc'; else $(CYGPATH_W) '$(srcdir)/lib/coord/helper_parent.cc'; fi`
    10911090
     1091pilot_node.o: lib/coord/pilot_node.cc
     1092@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT pilot_node.o -MD -MP -MF "$(DEPDIR)/pilot_node.Tpo" -c -o pilot_node.o `test -f 'lib/coord/pilot_node.cc' || echo '$(srcdir)/'`lib/coord/pilot_node.cc; \
     1093@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/pilot_node.Tpo" "$(DEPDIR)/pilot_node.Po"; else rm -f "$(DEPDIR)/pilot_node.Tpo"; exit 1; fi
     1094@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/coord/pilot_node.cc' object='pilot_node.o' libtool=no @AMDEPBACKSLASH@
     1095@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/pilot_node.Po' tmpdepfile='$(DEPDIR)/pilot_node.TPo' @AMDEPBACKSLASH@
     1096@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1097@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o pilot_node.o `test -f 'lib/coord/pilot_node.cc' || echo '$(srcdir)/'`lib/coord/pilot_node.cc
     1098
     1099pilot_node.obj: lib/coord/pilot_node.cc
     1100@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT pilot_node.obj -MD -MP -MF "$(DEPDIR)/pilot_node.Tpo" -c -o pilot_node.obj `if test -f 'lib/coord/pilot_node.cc'; then $(CYGPATH_W) 'lib/coord/pilot_node.cc'; else $(CYGPATH_W) '$(srcdir)/lib/coord/pilot_node.cc'; fi`; \
     1101@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/pilot_node.Tpo" "$(DEPDIR)/pilot_node.Po"; else rm -f "$(DEPDIR)/pilot_node.Tpo"; exit 1; fi
     1102@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/coord/pilot_node.cc' object='pilot_node.obj' libtool=no @AMDEPBACKSLASH@
     1103@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/pilot_node.Po' tmpdepfile='$(DEPDIR)/pilot_node.TPo' @AMDEPBACKSLASH@
     1104@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1105@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o pilot_node.obj `if test -f 'lib/coord/pilot_node.cc'; then $(CYGPATH_W) 'lib/coord/pilot_node.cc'; else $(CYGPATH_W) '$(srcdir)/lib/coord/pilot_node.cc'; fi`
     1106
    10921107graphics_engine.o: lib/graphics/graphics_engine.cc
    10931108@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT graphics_engine.o -MD -MP -MF "$(DEPDIR)/graphics_engine.Tpo" -c -o graphics_engine.o `test -f 'lib/graphics/graphics_engine.cc' || echo '$(srcdir)/'`lib/graphics/graphics_engine.cc; \
     
    12971312@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    12981313@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_emitter.obj `if test -f 'lib/graphics/particles/particle_emitter.cc'; then $(CYGPATH_W) 'lib/graphics/particles/particle_emitter.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/particles/particle_emitter.cc'; fi`
    1299 
    1300 base_entity.o: lib/lang/base_entity.cc
    1301 @am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT base_entity.o -MD -MP -MF "$(DEPDIR)/base_entity.Tpo" -c -o base_entity.o `test -f 'lib/lang/base_entity.cc' || echo '$(srcdir)/'`lib/lang/base_entity.cc; \
    1302 @am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/base_entity.Tpo" "$(DEPDIR)/base_entity.Po"; else rm -f "$(DEPDIR)/base_entity.Tpo"; exit 1; fi
    1303 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/lang/base_entity.cc' object='base_entity.o' libtool=no @AMDEPBACKSLASH@
    1304 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/base_entity.Po' tmpdepfile='$(DEPDIR)/base_entity.TPo' @AMDEPBACKSLASH@
    1305 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    1306 @am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o base_entity.o `test -f 'lib/lang/base_entity.cc' || echo '$(srcdir)/'`lib/lang/base_entity.cc
    1307 
    1308 base_entity.obj: lib/lang/base_entity.cc
    1309 @am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT base_entity.obj -MD -MP -MF "$(DEPDIR)/base_entity.Tpo" -c -o base_entity.obj `if test -f 'lib/lang/base_entity.cc'; then $(CYGPATH_W) 'lib/lang/base_entity.cc'; else $(CYGPATH_W) '$(srcdir)/lib/lang/base_entity.cc'; fi`; \
    1310 @am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/base_entity.Tpo" "$(DEPDIR)/base_entity.Po"; else rm -f "$(DEPDIR)/base_entity.Tpo"; exit 1; fi
    1311 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/lang/base_entity.cc' object='base_entity.obj' libtool=no @AMDEPBACKSLASH@
    1312 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/base_entity.Po' tmpdepfile='$(DEPDIR)/base_entity.TPo' @AMDEPBACKSLASH@
    1313 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    1314 @am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o base_entity.obj `if test -f 'lib/lang/base_entity.cc'; then $(CYGPATH_W) 'lib/lang/base_entity.cc'; else $(CYGPATH_W) '$(srcdir)/lib/lang/base_entity.cc'; fi`
    13151314
    13161315base_object.o: lib/lang/base_object.cc
  • orxonox/branches/physics/src/command_node.cc

    r4178 r4332  
    2424#include "list.h"
    2525#include "orxonox.h"
     26#include "p_node.h"
    2627
    2728#include <stdio.h>
     
    3738CommandNode::CommandNode (int ID)
    3839{
    39   this->bound = new tList<WorldEntity>();
     40  this->bound = new tList<PNode>();
    4041  this->aliases = NULL;
    4142  this->netID = ID;
     
    5455  this->bLocalInput = true;
    5556  this->netID = 0;
    56   this->bound = new tList<WorldEntity>();
     57  this->bound = new tList<PNode>();
    5758  this->bEnabled = true;
    5859  this->world = NULL;
     
    194195   \param entity: Pointer to the entity to bind
    195196*/
    196 void CommandNode::bind (WorldEntity* entity)
     197void CommandNode::bind (PNode* entity)
    197198{
    198199  bound->add (entity);
     
    203204   \param entity: Pointer to the entity to relese
    204205*/
    205 void CommandNode::unbind (WorldEntity* entity)
     206void CommandNode::unbind (PNode* entity)
    206207{
    207208  bound->remove (entity);
     
    264265          cmd.xrel = event.motion.xrel;
    265266          cmd.yrel = event.motion.yrel;
     267          if( strlen (cmd.cmd) > 0) relay(&cmd);
    266268          break;
    267269        case SDL_MOUSEBUTTONUP:
     
    308310  if( this->world->command(cmd)) return;
    309311
    310   tIterator<WorldEntity>* iterator = bound->getIterator();
    311   WorldEntity* entity = iterator->nextElement();
     312  tIterator<PNode>* iterator = bound->getIterator();
     313  PNode* entity = iterator->nextElement();
    312314  while( entity != NULL)
    313315    {
    314       entity->command (cmd); /*no absorbtion of command! strange*/
     316      ((WorldEntity*)entity)->command (cmd); /*no absorbtion of command! strange*/
    315317      entity = iterator->nextElement();
    316318    }
  • orxonox/branches/physics/src/command_node.h

    r4178 r4332  
    1515class WorldEntity;
    1616class World;
     17class PNode;
    1718
    1819#define N_STD_KEYS SDLK_LAST
     
    4546  int netID;    //!< Unique identifier that is used to determine between remote CommandNodes
    4647  KeyBindings* aliases;
    47   tList<WorldEntity>* bound;    //!< List of WorldEntites that recieve commands from this CommandNode
     48  tList<PNode>* bound;  //!< List of WorldEntites that recieve commands from this CommandNode
    4849  Sint32 coord[2];
    4950  World* world;
     
    6465  void enable (bool bEnabled);
    6566  void loadBindings (char* filename);
    66   void bind (WorldEntity* entity);
    67   void unbind (WorldEntity* entity);
     67  void bind (PNode* entity);
     68  void unbind (PNode* entity);
    6869  void addToWorld (World* world);
    6970  void process ();
  • orxonox/branches/physics/src/glmenu/glmenu_imagescreen.cc

    r4283 r4332  
    8888void GLMenuImageScreen::init ()
    8989{
    90   this->setClassName ("GLMenuImageScreen");
     90  this->setClassID(CL_GLMENU_IMAGE_SCREEN, "GLMenuImageScreen");
    9191
    9292  // Select Our VU Meter Background Texture
  • orxonox/branches/physics/src/lib/coord/helper_parent.cc

    r3544 r4332  
    3030HelperParent::HelperParent ()
    3131{
    32    this->setClassName ("HelperParent");
     32   this->setClassID(CL_HELPER_PARENT, "HelperParent");
    3333}
    3434
  • orxonox/branches/physics/src/lib/coord/p_node.h

    r4274 r4332  
    9393  const char* getName ();
    9494
    95 
    9695  void debug ();
    9796
  • orxonox/branches/physics/src/lib/graphics/graphics_engine.cc

    r4283 r4332  
    3434  this->minFPS = 9999;
    3535  this->maxFPS = 0;
    36   this->setClassName ("GraphicsEngine");
     36  this->setClassID(CL_GRAPHICS_ENGINE, "GraphicsEngine");
    3737
    3838  this->fullscreen = false;
  • orxonox/branches/physics/src/lib/graphics/light.cc

    r3809 r4332  
    3434Light::Light(int lightNumber)
    3535{
    36   this->setClassName("Light");
     36  this->setClassID(CL_LIGHT, "Light");
    3737  char tmpName[7];
    3838  sprintf(tmpName, "Light%d", lightNumber);
     
    205205LightManager::LightManager ()
    206206{
    207   this->setClassName ("LightManager");
     207  this->setClassID(CL_LIGHT_MANAGER, "LightManager");
    208208
    209209  glEnable (GL_LIGHTING);
  • orxonox/branches/physics/src/lib/graphics/particles/particle_emitter.cc

    r4328 r4332  
    3030                  float velocity)
    3131{
    32    this->setClassName ("ParticleEmitter");
     32   this->setClassID(CL_PARTICLE_EMITTER, "ParticleEmitter");
    3333
    3434   this->type = EMITTER_DOT;
  • orxonox/branches/physics/src/lib/graphics/particles/particle_engine.cc

    r4308 r4332  
    3030ParticleEngine::ParticleEngine ()
    3131{
    32    this->setClassName ("ParticleEngine");
     32   this->setClassID(CL_PARTICLE_ENGINE, "ParticleEngine");
    3333
    3434   this->systemList = new tList<ParticleSystem>;
  • orxonox/branches/physics/src/lib/graphics/particles/particle_system.cc

    r4330 r4332  
    4242ParticleSystem::ParticleSystem (unsigned int maxCount, PARTICLE_TYPE type)
    4343{
    44   this->setClassName ("ParticleSystem");
     44   this->setClassID(CL_PARTICLE_SYSTEM, "ParticleSystem");
    4545  this->material = NULL;
    4646  this->name = NULL;
  • orxonox/branches/physics/src/lib/graphics/text_engine.cc

    r3953 r4332  
    5151Text::Text(Font* font, int type)
    5252{
    53   this->setClassName("Text");
     53  this->setClassID(CL_TEXT, "Text");
    5454
    5555  // initialize this Text
     
    802802TextEngine::TextEngine ()
    803803{
    804    this->setClassName ("TextEngine");
     804   this->setClassID(CL_TEXT_ENGINE, "TextEngine");
    805805   this->enableFonts();
    806806
  • orxonox/branches/physics/src/lib/lang/base_object.cc

    r4283 r4332  
    3030{
    3131  this->className = NULL;
     32  this->id = -1;
    3233  this->finalized = false;
    3334}
     
    4243}
    4344
    44 void BaseObject::setClassName (const char* className)
     45
     46/**
     47   \brief sets the class identifiers
     48   \param a number for the class from class_list.h enumeration
     49   \param the class name
     50*/
     51void BaseObject::setClassID(int id, const char* className)
     52{
     53  this->id = id;
     54  this->className = className;
     55}
     56
     57
     58/**
     59   \brief sets the class identifier
     60   \param a number for the class from class_list.h enumeration
     61*/
     62void BaseObject::setClassID (int id)
     63{
     64  this->id = id;
     65}
     66
     67
     68/**
     69   \brief sets the class identifiers
     70   \param the class name
     71*/
     72void BaseObject::setClassName(const char* className)
    4573{
    4674  this->className = className;
    4775}
    4876
     77
     78/**
     79   \brief sets the class identifiers
     80   \param a number for the class from class_list.h enumeration
     81   \param the class name
     82*/
    4983bool BaseObject::isA (char* className)
    5084{
     
    5488}
    5589
     90
    5691/*
    57 bool BaseObject::isFinalized()
    58 {
    59  
    60 }
     92  \brief this finalizes an object and makes it ready to be garbage collected
    6193*/
    62 
    6394void BaseObject::finalize()
    6495{
  • orxonox/branches/physics/src/lib/lang/base_object.h

    r4283 r4332  
    99
    1010#include "stdincl.h"
    11 
     11#include "class_list.h"
    1212
    1313class BaseObject {
     
    1717  virtual ~BaseObject ();
    1818
    19   void setClassName (const char* className);
     19  void setClassID(int id);
     20  void setClassName(const char* className);
     21  void setClassID(int id, const char* className);
     22
    2023  inline const char* getClassName(void) const { return this->className;};
     24  inline int getClassID(void) const { return this->id; }
    2125  bool isA (char* className);
    2226
     
    2529
    2630 private:
    27   const char* className;
    28   bool finalized;
     31  const char*    className;                       //!< the name of the class
     32  int            id;                              //!< this is the id from the class_list.h enumeration
     33  bool           finalized;                       //!< is true if the object is ready to be garbage collected
    2934};
    3035
  • orxonox/branches/physics/src/proto/proto_class.cc

    r4178 r4332  
    2727ProtoClass::ProtoClass ()
    2828{
    29    this->setClassName ("ProtoClass");
     29   this->setClassID(CL_PROTO_ID, "ProtoClass");
     30
     31   /* If you make a new class, what is most probably the case when you write this file
     32      don't forget to:
     33       1. Add the new file new_class.cc to the ./src/Makefile.am
     34       2. Add the class identifier to ./src/class_list.h eg. CL_NEW_CLASS
     35
     36      Advanced Topics:
     37      - if you want to let your object be managed via the ObjectManager make sure to read
     38        the object_manager.h header comments. You will use this most certanly only if you
     39        make many objects of your class, like a weapon bullet.
     40   */
    3041}
    3142
  • orxonox/branches/physics/src/proto/proto_singleton.cc

    r3655 r4332  
    2626ProtoSingleton::ProtoSingleton ()
    2727{
    28    this->setClassName ("ProtoSingleton");
     28   this->setClassName("ProtoSingleton");
     29   this->setClassID(CL_PROTO_ID, "ProtoSingleton");
    2930
     31   /* If you make a new class, what is most probably the case when you write this file
     32      don't forget to:
     33       1. Add the new file new_class.cc to the ./src/Makefile.am
     34       2. Add the class identifier to ./src/class_list.h eg. CL_NEW_CLASS
     35
     36      Advanced Topics:
     37      - if you want to let your object be managed via the ObjectManager make sure to read
     38        the object_manager.h header comments. You will use this most certanly only if you
     39        make many objects of your class, like a weapon bullet.
     40   */
    3041}
    3142
  • orxonox/branches/physics/src/story_entities/campaign.cc

    r4283 r4332  
    110110ErrorMessage Campaign::start(int storyID = 0)
    111111{
    112   printf("World::start() - starting new StoryEntity Nr:%i\n", storyID);
    113112  ErrorMessage errorCode;
    114113  if( !this->isInit) return errorCode;
     
    119118  while( se != NULL && this->running)
    120119    {
     120      PRINTF(0)("Starting new StoryEntity Nr:%i\n", se->getStoryID());
    121121      se->displayLoadScreen();
    122122      se->preLoad();
     
    135135      if( ( nextWorldID == WORLD_ID_GAMEEND) ||( se == NULL) )
    136136        {
    137           printf("Campaign::start() - quitting campaing story loop\n");
     137          PRINTF(0)("Quitting campaing story loop\n");
    138138          if(se != NULL)
    139139            delete se;
  • orxonox/branches/physics/src/story_entities/world.cc

    r4314 r4332  
    2727#include "null_parent.h"
    2828#include "helper_parent.h"
     29#include "pilot_node.h"
    2930#include "track_node.h"
    3031#include "world_entity.h"
     
    201202void World::constuctorInit(char* name, int worldID)
    202203{
    203   this->setClassName ("World");
     204  this->setClassID(CL_WORLD, "World");
    204205
    205206  //this->worldName = name;
     
    288289
    289290  this->localCamera = new Camera();
    290   this->localCamera->setName ("camera");
     291  this->localCamera->setName ("Camera");
    291292
    292293  State::getInstance()->setCamera(this->localCamera, this->localCamera->getTarget());
     
    308309    {
    309310      PRINTF(1)("World has no path specified for loading");
     311      this->loadDebugWorld(this->getStoryID());
    310312      return (ErrorMessage){213,"Path not specified","World::load()"};
    311313    }
     
    500502
    501503
     504
     505/**
     506   \brief loads the debug world: only for experimental stuff
     507*/
    502508void World::loadDebugWorld(int worldID)
    503509{
     510  printf("ajsdflkajs;dlfaj;slfja;lsjf;lajsf;la;sdfkja;lskdjfashdfklajshdflkjasdfh\n");
    504511  /*monitor progress*/
    505512  this->glmis->step();
     
    566573  lightMan->setAmbientColor(.1,.1,.1);
    567574  lightMan->addLight();
    568   //      lightMan->setAttenuation(1.0, .01, 0.0);
    569   //      lightMan->setDiffuseColor(1,1,1);
    570   //  lightMan->addLight(1);
    571   //  lightMan->setPosition(20, 10, -20);
    572   //  lightMan->setDiffuseColor(0,0,0);
    573575  lightMan->debug();
    574576
     
    585587        lightMan->setPosition(-5.0, 10.0, -40.0);
    586588
    587         // !\todo old track-system has to be removed
    588 
    589         //create helper for player
    590         //HelperParent* hp = new HelperParent ();
    591         /* the player has to be added to this helper */
    592 
    593         // create a player
     589
    594590        this->localPlayer = new Player ();
    595591        this->localPlayer->setName ("player");
    596592        this->spawn (this->localPlayer);
    597593        /*monitor progress*/
    598         //this->glmis->step();
    599594        this->glmis->step();
    600595
    601         // bind input
    602         Orxonox *orx = Orxonox::getInstance ();
    603         orx->getLocalInput()->bind (this->localPlayer);
    604            
    605596        // bind camera
    606597        this->localCamera = new Camera();
    607598        this->localCamera->setName ("camera");
    608            
    609599        /*monitor progress*/
    610600        this->glmis->step();
    611601
    612         sky = new SkyBox();
    613         //      (SkyBox*)(sky)->setTexture("pictures/sky/skybox", "jpg");
    614         sky->setParent(localCamera);
    615         this->spawn(sky);
    616 
    617         /*monitor progress*/
    618         this->glmis->step();
    619 
    620            
    621         WorldEntity* env = new Environment();
    622         env->setName ("env");
    623         this->spawn(env);
    624 
    625            
    626         /*
    627           Vector* es = new Vector (10, 5, 0);
    628           Quaternion* qs = new Quaternion ();
    629           WorldEntity* pr = new Primitive(P_CYLINDER);
    630           pr->setName("primitive");
    631           this->spawn(pr, this->localPlayer, es, qs, PNODE_MOVEMENT);
    632         */
    633 
    634         /*monitor progress*/
    635         this->glmis->step();
    636 
    637         //          trackManager->setBindSlave(env);
    638         PNode* tn = trackManager->getTrackNode();
    639         tn->addChild(this->localPlayer);
    640         this->localCamera->lookAt(tn);
    641 
    642         //localCamera->setParent(TrackNode::getInstance());
    643         tn->addChild(this->localCamera);
    644         //          localCamera->lookAt(tn);
    645         this->localPlayer->setMode(PNODE_ALL);
    646         //Vector* cameraOffset = new Vector (0, 5, -10);
    647         trackManager->condition(2, LEFTRIGHT, this->localPlayer);
    648         this->glmis->step();
    649         break;
    650       }
    651     case DEBUG_WORLD_1:
    652       {
    653         lightMan->setPosition(.0, .0, .0);
    654         lightMan->setAttenuation(1.0, .01, 0.0);
    655         lightMan->setSpecularColor(1,0,0);
    656         this->nullParent = NullParent::getInstance ();
    657         this->nullParent->setName ("NullParent");
    658 
    659         // create a player
    660         WorldEntity* myPlayer = new Player();
    661         myPlayer->setName ("player");
    662         this->spawn(myPlayer);
    663         this->localPlayer = myPlayer;       
    664            
    665         // bind input
    666         Orxonox *orx = Orxonox::getInstance();
    667         orx->getLocalInput()->bind (myPlayer);
    668            
    669         // bind camera
    670         this->localCamera = new Camera ();
    671         this->localCamera->setName ("camera");
    672         this->localCamera->lookAt(LightManager::getInstance()->getLight(0));
    673         this->localCamera->setParent(this->localPlayer);
    674 
    675         // Create SkySphere
    676         sky = new Skysphere("pictures/sky-replace.jpg");
    677         this->localPlayer->addChild(this->sky);
    678         this->spawn(this->sky);
    679         Vector* es = new Vector (20, 0, 0);
    680         Quaternion* qs = new Quaternion ();
    681 
    682         lightMan->getLight(0)->setParent(trackManager->getTrackNode());
    683         break;
    684       }
    685     case DEBUG_WORLD_2:
    686       {
    687         lightMan->setAmbientColor(.1,.1,.1);
    688         lightMan->addLight();
    689         lightMan->setPosition(-5.0, 10.0, -40.0);
    690         this->nullParent = NullParent::getInstance ();
    691         this->nullParent->setName ("NullParent");
    692 
    693         // !\todo old track-system has to be removed
    694 
    695         //create helper for player
    696         //HelperParent* hp = new HelperParent ();
    697         /* the player has to be added to this helper */
    698 
    699         // create a player
    700         this->localPlayer = new Player ();
    701         this->localPlayer->setName ("player");
    702         this->spawn (this->localPlayer);
    703         /*monitor progress*/
    704         //this->glmis->step();     
    705         this->glmis->step();
    706 
    707         // bind input
    708         Orxonox *orx = Orxonox::getInstance ();
    709         orx->getLocalInput()->bind (this->localPlayer);
    710            
    711         // bind camera
    712         this->localCamera = new Camera();
    713         this->localCamera->setName ("camera");
    714         this->localCamera->lookAt(this->localPlayer);
    715         this->localCamera->setParent(this->localPlayer);
    716            
    717         /*monitor progress*/
    718         this->glmis->step();
    719602
    720603        // Create SkySphere
     
    728611
    729612
    730         WorldEntity* baseNode = new Satellite(Vector(1,0,1), 1.2);
    731         this->localPlayer->addChild(baseNode);
    732         baseNode->setRelCoor(Vector(10.0, 2.0, 1.0));
    733         this->spawn(baseNode);
    734 
    735         WorldEntity* secondNode = new Satellite(Vector(0,0,1), 2.0);
    736         baseNode->addChild(secondNode);
    737         secondNode->setRelCoor(Vector(0.0, 0.0, 3.0));
    738         this->spawn(secondNode);
    739 
    740 
    741         WorldEntity* thirdNode = new Satellite(Vector(0,0,1), 1.0);
    742         secondNode->addChild(thirdNode);
    743         thirdNode->setRelCoor(Vector(2.0, 0.0, 0.0));
    744         this->spawn(thirdNode);
    745 
    746            
    747    
    748         WorldEntity* c = new Environment();
    749         this->localPlayer->addChild(c);
    750         c->setRelCoor(Vector(10.0, 2.0, -1.0));
    751         this->spawn(c);
    752 
    753 
    754            
    755         Animation3D* animation = new Animation3D(c);
    756         animation->setInfinity(ANIM_INF_REPLAY);
    757 
    758 
    759         animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR);
    760         animation->addKeyFrame(Vector(0, 2, 0), Quaternion(M_PI, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR);
    761         animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR);
    762 
    763 
    764 
    765 
    766 
    767 
    768         /*         
    769           KeyFrame* f1 = new KeyFrame;
    770           f1->position = new Vector(-1.1, 0.0, 2.6);
    771           f1->direction = new Quaternion();
    772           f1->time = 1.0;
    773           f1->mode = NEG_EXP;
    774                  
    775                  
    776           KeyFrame* f2 = new KeyFrame;
    777           f2->position = new Vector(-2.1, 0.0, 2.6);
    778           f2->direction = new Quaternion();
    779           f2->time = 0.1;
    780           f2->mode = NEG_EXP;
    781                  
    782           KeyFrame* f3 = new KeyFrame;
    783           f3->position = new Vector(10.0, 2.0, -1.0);
    784           f3->direction = new Quaternion();
    785           f3->time = 0.2;
    786           f3->mode = NEG_EXP;
    787                  
    788           KeyFrame* f4 = new KeyFrame;
    789           f4->position = new Vector(10.0, 5.0, -1.0);
    790           f4->direction = new Quaternion();
    791           f4->time = 1.0;
    792           f4->mode = NEG_EXP;
    793                  
    794                  
    795                  
    796           this->simpleAnimation->animatorBegin();
    797           this->simpleAnimation->selectObject(b);
    798           this->simpleAnimation->setAnimationMode(SINGLE);
    799           this->simpleAnimation->addKeyFrame(f1);
    800           this->simpleAnimation->addKeyFrame(f2);
    801           this->simpleAnimation->start();
    802           this->simpleAnimation->selectObject(c);
    803           this->simpleAnimation->addKeyFrame(f3);
    804           this->simpleAnimation->addKeyFrame(f4);
    805           this->simpleAnimation->start();
    806           this->simpleAnimation->animatorEnd();
    807         */
    808 
    809         /*
    810           Vector* es = new Vector (10, 5, 0);
    811           Quaternion* qs = new Quaternion ();
    812           WorldEntity* pr = new Primitive(P_CYLINDER);
    813           pr->setName("primitive");
    814           this->spawn(pr, this->localPlayer, es, qs, PNODE_MOVEMENT);
    815         */
    816 
     613        terrain = new Terrain("worlds/newGround.obj");
     614        terrain->setRelCoor(Vector(0,-10,0));
     615        this->spawn(terrain);
    817616        /*monitor progress*/
    818617        this->glmis->step();
    819618
    820         //          trackManager->setBindSlave(env);
     619        this->pilotNode = new PilotNode();
     620        this->pilotNode->addChild(this->localPlayer);
     621        this->pilotNode->addChild(this->localCamera);
     622        // bind input
     623        Orxonox *orx = Orxonox::getInstance ();
     624        //orx->getLocalInput()->bind (this->pilotNode);     
     625       
     626        /*
    821627        PNode* tn = trackManager->getTrackNode();
    822628        tn->addChild(this->localPlayer);
    823 
    824         //localCamera->setParent(TrackNode::getInstance());
     629        this->localCamera->lookAt(tn);
     630       
    825631        tn->addChild(this->localCamera);
    826         //          localCamera->lookAt(tn);
    827632        this->localPlayer->setMode(PNODE_ALL);
    828         //Vector* cameraOffset = new Vector (0, 5, -10);
    829633        trackManager->condition(2, LEFTRIGHT, this->localPlayer);
     634        */
    830635        this->glmis->step();
     636        break;
     637      }
     638    case DEBUG_WORLD_1:
     639      {
     640
     641        break;
     642      }
     643    case DEBUG_WORLD_2:
     644      {
    831645
    832646        break;
    833647      }
    834648    default:
    835       printf("World::load() - no world with ID %i found", this->debugWorldNr );
     649      break;
    836650    }
    837651}
     
    848662{
    849663  this->bPause = false;
     664  this->pilotNode = NULL;
    850665  CommandNode* cn = Orxonox::getInstance()->getLocalInput();
    851666  cn->addToWorld(this);
     
    13211136  else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW4)) this->localCamera->setViewMode(VIEW_RIGHT);
    13221137  else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW5)) this->localCamera->setViewMode(VIEW_TOP);
    1323 
     1138  else if(this->pilotNode != NULL) if( !strcmp( cmd->cmd, "cursor")) this->pilotNode->command(cmd);
    13241139  return false;
    13251140}
  • orxonox/branches/physics/src/story_entities/world.h

    r4283 r4332  
    2424class Text;
    2525class TiXmlElement;
     26class PilotNode;
    2627
    2728//! The game world Interface
     
    123124  tList<WorldEntity>* entities;       //!< A template List of all entities. Every moving thing should be included here, and world automatically updates them.
    124125  WorldEntity* localPlayer;           //!< The Player, you fly through the level.
     126  PilotNode* pilotNode;               //!< THe pilot node to fly with the mouse
    125127
    126128  GarbageCollector* garbageCollector; //!< reference to the garbage  collector
  • orxonox/branches/physics/src/util/animation/animation_player.cc

    r3953 r4332  
    2828AnimationPlayer::AnimationPlayer ()
    2929{
    30    this->setClassName ("AnimationPlayer");
     30   this->setClassID(CL_ANIMATION_PLAYER, "AnimationPlayer");
    3131
    3232   this->animationList = new tList<Animation>();
  • orxonox/branches/physics/src/util/garbage_collector.cc

    r4301 r4332  
    3838GarbageCollector::GarbageCollector ()
    3939{
    40    this->setClassName ("GarbageCollection");
     40   this->setClassID(CL_GARBAGE_COLLECTOR, "GarbageCollector");
    4141   this->time = 0;
    4242   this->delay = 1.5f; /* clean up all 5.0 seconds */
     
    139139          /* then finaly delete reference */
    140140          //delete entity;
    141           ObjectManager::getInstance()->addToDeadList(CL_TEST_BULLET, entity);
    142           ObjectManager::getInstance()->debug();
     141          ObjectManager::getInstance()->addToDeadList(entity->getClassID(), entity);
    143142        }
    144143      entity = iterator->nextElement();
     
    148147  PRINTF(3)("=============================\n");
    149148
     149  ObjectManager::getInstance()->debug();
     150
    150151  /* reset time to count again up to this->delay */
    151152  this->time = 0;
  • orxonox/branches/physics/src/util/loading/game_loader.cc

    r4283 r4332  
    8282      delete campaignName;
    8383    }
     84  World* world0 = new World(DEBUG_WORLD_0);
     85  world0->setNextStoryID(WORLD_ID_GAMEEND);
     86  this->currentCampaign->addEntity(world0, WORLD_ID_2);
    8487}
    8588
  • orxonox/branches/physics/src/util/loading/load_param.h

    r4301 r4332  
    180180  static LoadClassDescription* addClass(const char* className);
    181181  LoadParamDescription* addParam(const char* paramName);
     182 
    182183
    183184  static void printAll(const char* fileName = NULL);
  • orxonox/branches/physics/src/util/object_manager.cc

    r4301 r4332  
    2828ObjectManager::ObjectManager ()
    2929{
    30   this->setClassName ("ObjectManager");
     30  this->setClassID(CL_OBJECT_MANAGER, "ObjectManager");
    3131 
    32   //this->managedObjectList = new BaseObject*[CL_NUMBER];
    3332  this->managedObjectList = new tList<BaseObject>*[CL_NUMBER];
     33  for(int i = 0; i < CL_NUMBER; ++i)
     34    {
     35      this->managedObjectList[i] = NULL;
     36    }
    3437
    3538  this->garbageCollector = GarbageCollector::getInstance();
    3639}
     40
    3741
    3842/**
     
    6266
    6367
    64 void ObjectManager::cache(classList index, int number, const BaseObject &copyObject)
    65 {
    66   //this->managedObjectList[index] = new BaseObject[number];
    67   this->managedObjectList[index] = new tList<BaseObject>();
    68   for(int i = 0; i < number; ++i)
    69     {
    70       this->managedObjectList[index]->add(new BaseObject(copyObject));
    71     }
    72 }
    73 
    74 
    75 void ObjectManager::addToDeadList(classList index, BaseObject* object)
     68void ObjectManager::addToDeadList(int index, BaseObject* object)
    7669{
    7770  if( likely(this->managedObjectList[index] != NULL))
    7871    this->managedObjectList[index]->add(object);
    7972  else
    80     PRINTF(0)(" Error: unable to add object to the list nr. %i: no list initialized - ignoring\n", index);
     73    PRINTF(0)(" Critical: unable to add object to the list nr. %i: no list initialized - ignoring\n", index);
    8174}
    8275
    8376
    84 BaseObject* ObjectManager::getFromDeadList(classList index, int number)
     77BaseObject* ObjectManager::getFromDeadList(int index, int number)
    8578{
    8679  if( likely(this->managedObjectList[index] != NULL))
     
    8881      BaseObject* obj = this->managedObjectList[index]->firstElement();
    8982      this->managedObjectList[index]->remove(obj);
     83      if( unlikely(obj == NULL))
     84        {
     85          PRINTF(0)("Critical: there was no object anymore in the dead list! This could result in Segfaults\n");
     86        }
    9087      return obj;
    9188    }
    9289  else
    93     PRINTF(0)(" Error: unable to get object from the list nr. %i: no elements initialized - ignoring\n", index);
     90    PRINTF(0)(" Critical: unable to get object from the list nr. %i: no elements initialized - ignoring\n", index);
     91  return NULL;
    9492}
    9593
     
    102100  for(int i = 0; i < CL_NUMBER; ++i)
    103101    {
    104       if(this->managedObjectList[i] != NULL)
     102      if( this->managedObjectList[i] != NULL)
    105103        PRINT(0)("=   o Class Nr. %i has cached %i object(s)\n", i, this->managedObjectList[i]->getSize());
    106104      else
  • orxonox/branches/physics/src/util/object_manager.h

    r4301 r4332  
    88    - recycle deleted objects: specific for Projectils since there is a lot of world entity creation/deletion (and this needs a lot of time)
    99    - control the garbage collector
     10
     11    TO ADD SUPPORT FOR A CLASS do the following steps:
     12    1. include the hader file : #include "class_header.h"
     13    2. add the class to the type enum classList {}; in class_list.h
     14    3. define a function void mCache( ClassName ) in class ObjectManager
     15
    1016*/
    1117
     
    1521
    1622#include "base_object.h"
    17 
    18 #define OM_
     23#include "projectile.h"
     24#include "list.h"
    1925
    2026#include "class_list.h"
    21 
     27 
    2228
    2329class WorldEntity;
     
    2531
    2632
    27 template<class T> class tList;
    28 template<class T> class ManagedObject;
     33//! This defines the "template" makro function for cache(...)
     34#define mCache( Class ) \
     35 cache(classList index, int number, Class * copyObject)        \
     36{                                                              \
     37  this->managedObjectList[index] = new tList<BaseObject>(); \
     38  for(int i = 0; i < number; ++i)\
     39    {\
     40      this->managedObjectList[index]->add(new Class (*copyObject));\
     41    }\
     42}
     43
     44
    2945
    3046//! the object manager itself
     
    3551  virtual ~ObjectManager(void);
    3652 
    37   void cache(classList index, int number, const BaseObject &copyObject);
    38   void addToDeadList(classList index, BaseObject* object);
    39   BaseObject* getFromDeadList(classList index, int number = 1);
     53  void mCache(Projectile);
     54  void addToDeadList(int index, BaseObject* object);
     55  BaseObject* getFromDeadList(int index, int number = 1);
    4056
    4157  void debug();
     
    4359 private:
    4460  ObjectManager(void);
     61
    4562  static ObjectManager* singletonRef;
    4663
    47   //BaseObject** managedObjectList;
    4864  tList<BaseObject>** managedObjectList;
    4965  GarbageCollector* garbageCollector;
  • orxonox/branches/physics/src/util/resource_manager.cc

    r4295 r4332  
    3838ResourceManager::ResourceManager ()
    3939{
    40    this->setClassName ("ResourceManager");
     40   this->setClassID(CL_RESOURCE_MANAGER, "ResourceManager");
    4141   this->dataDir = NULL;
    4242   this->setDataDir("./");
  • orxonox/branches/physics/src/util/track/track_manager.cc

    r4283 r4332  
    370370TrackManager::TrackManager(void)
    371371{
    372   this->setClassName("TrackManager");
     372  this->setClassID(CL_TRACK_MANAGER, "TrackManager");
    373373 
    374374  TrackManager::singletonRef = this; // do this because otherwise the TrackNode cannot get The instance of the TrackManager
  • orxonox/branches/physics/src/util/track/track_node.cc

    r4283 r4332  
    3232TrackNode::TrackNode ()
    3333{
    34   this->setClassName("TrackNode");
     34  this->setClassID(CL_TRACK_NODE, "TrackNode");
    3535  this->setName("TrackNode"); /* absolete but still used... */
    3636
  • orxonox/branches/physics/src/world_entities/camera.cc

    r4178 r4332  
    3333Camera::Camera(void)
    3434{
    35   this->setClassName("Camera");
     35  this->setClassID(CL_CAMERA, "Camera");
    3636  this->target = new CameraTarget();
    3737
     
    190190CameraTarget::CameraTarget()
    191191{
    192   this->setClassName("CameraTarget");
     192  this->setClassID(CL_CAMERA_TARGET, "CameraTarget");
    193193  this->setMode(PNODE_MOVEMENT);
    194194}
  • orxonox/branches/physics/src/world_entities/character_attributes.cc

    r3583 r4332  
    2929CharacterAttributes::CharacterAttributes ()
    3030{
    31    this->setClassName ("CharacterAttributes");
     31   this->setClassID(CL_CHARACTER_ATTRIBUTES, "CharacterAttributes");
    3232}
    3333
  • orxonox/branches/physics/src/world_entities/projectile.cc

    r3755 r4332  
    3333Projectile::Projectile (Weapon* weapon) : WorldEntity()
    3434{
     35  this->setClassID(CL_PROJECTILE, "Projectile");
    3536  this->weapon = weapon;
    3637  this->flightDirection = NULL;
  • orxonox/branches/physics/src/world_entities/satellite.cc

    r3750 r4332  
    3131Satellite::Satellite (Vector axis, float speed)
    3232{
    33   this->setClassName ("Satellite");
     33  this->setClassID(CL_SATELLITE, "Satellite");
    3434  this->model = (Model*) ResourceManager::getInstance()->load("cube", RP_LEVEL);
    3535  this->speed = speed;
  • orxonox/branches/physics/src/world_entities/skybox.cc

    r4283 r4332  
    6262void SkyBox::preInit(void)
    6363{
    64   this->setClassName("SkyBox");
     64  this->setClassID(CL_SKYBOX, "SkyBox");
    6565  this->skyModel = NULL;
    6666  this->material = new Material*[6];
  • orxonox/branches/physics/src/world_entities/terrain.cc

    r4178 r4332  
    7777void Terrain::init(void)
    7878{
    79   this->setClassName ("Terrain");
    80  
     79  this->setClassID(CL_TERRAIN, "Terrain");
    8180  this->objectList = 0;
    8281}
  • orxonox/branches/physics/src/world_entities/test_bullet.cc

    r3757 r4332  
    3333TestBullet::TestBullet (Weapon* weapon) : Projectile(weapon)
    3434{
     35  this->setClassID(CL_TEST_BULLET, "TestBullet");
    3536  this->model = (Model*)ResourceManager::getInstance()->load("models/test_projectile.obj", OBJ, RP_LEVEL);
    3637}
  • orxonox/branches/physics/src/world_entities/test_entity.cc

    r4283 r4332  
    2828TestEntity::TestEntity () : WorldEntity()
    2929
     30  this->setClassID(CL_TEST_ENTITY, "TestEntity");
    3031  this->md2Model = new MD2Model();
    3132  this->md2Model->loadModel(ResourceManager::getFullName("models/tris.md2"));
  • orxonox/branches/physics/src/world_entities/test_gun.cc

    r4301 r4332  
    4545  :  Weapon (parent, coordinate, direction)
    4646{
     47  this->setClassID(CL_TEST_GUN, "TestGun");
    4748  this->model = (Model*)ResourceManager::getInstance()->load("models/test_gun.obj", OBJ, RP_CAMPAIGN);
    4849  this->idleTime = 0.2f;
     
    8990    }
    9091
    91   BaseObject* p = new TestBullet(this);
    92   ObjectManager::getInstance()->cache(CL_TEST_BULLET, 100, *p);
     92  Projectile* p = new TestBullet(this);
     93  ObjectManager::getInstance()->cache(CL_TEST_BULLET, 100, p);
    9394  ObjectManager::getInstance()->debug();
    9495}
     
    143144    }
    144145
    145   Projectile* pj = new TestBullet(this);
     146  Projectile* pj = (TestBullet*)ObjectManager::getInstance()->getFromDeadList(CL_TEST_BULLET);
     147
     148  //printf( "object ref %p\n", ObjectManager::getInstance()->getFromDeadList(CL_TEST_BULLET));
     149
     150  //Projectile* pj = new TestBullet(this);
    146151  pj->setAbsCoor(this->getAbsCoor() + this->projectileOffset);
    147152  pj->setAbsDir(this->getAbsDir());
  • orxonox/branches/physics/src/world_entities/world_entity.cc

    r4283 r4332  
    3030WorldEntity::WorldEntity(const TiXmlElement* root)
    3131{
    32   this->setClassName ("WorldEntity");
     32  this->setClassID(CL_WORLD_ENTITY, "WorldEntity");
    3333  this->model = NULL;
    3434
Note: See TracChangeset for help on using the changeset viewer.