Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4877 in orxonox.OLD


Ignore:
Timestamp:
Jul 16, 2005, 10:38:04 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/weaponSystem: cleanup WorldEntity and Player (or at least started cleaning up)

Location:
orxonox/branches/weaponSystem
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/weaponSystem/orxonox.kdevelop

    r4662 r4877  
    1 <?xml version = '1.0'?>
     1<?xml version="1.0"?>
    22<kdevelop>
     3 <general>
     4  <author>orxonox-crew:</author>
     5  <email>orxonox-dev@mail.datacore.ch</email>
     6  <version>$VERSION$</version>
     7  <projectmanagement>KDevCustomProject</projectmanagement>
     8  <primarylanguage>C++</primarylanguage>
     9  <ignoreparts>
     10  </ignoreparts>
     11 </general>
     12 <kdevcustomproject>
     13  <run>
     14   <mainprogram>orxonox</mainprogram>
     15  </run>
     16 </kdevcustomproject>
     17 <kdevdebugger>
    318  <general>
    4     <author>orxonox-crew:</author>
    5     <email>orxonox-dev@mail.datacore.ch</email>
    6     <version>$VERSION$</version>
    7     <projectmanagement>KDevAutoProject</projectmanagement>
    8     <primarylanguage>C++</primarylanguage>
    9     <ignoreparts/>
    10     <projectdirectory>.</projectdirectory>
    11     <absoluteprojectpath>false</absoluteprojectpath>
    12     <description/>
    13     <secondaryLanguages/>
    14     <versioncontrol/>
     19   <dbgshell></dbgshell>
    1520  </general>
    16   <kdevautoproject>
    17     <general>
    18       <activetarget>src/subprojects/particles/particles</activetarget>
    19       <useconfiguration>default</useconfiguration>
    20     </general>
    21     <run>
    22       <mainprogram>src/orxonox</mainprogram>
    23       <directoryradio>executable</directoryradio>
    24       <customdirectory>/</customdirectory>
    25       <programargs/>
    26       <terminal>false</terminal>
    27       <autocompile>true</autocompile>
    28       <envvars/>
    29       <runarguments>
    30         <orxonox/>
    31       </runarguments>
    32     </run>
    33     <configurations>
    34       <optimized>
    35         <builddir>optimized</builddir>
    36         <ccompiler>GccOptions</ccompiler>
    37         <cxxcompiler>GppOptions</cxxcompiler>
    38         <f77compiler>G77Options</f77compiler>
    39         <cxxflags>-O2 -g0</cxxflags>
    40       </optimized>
    41       <debug>
    42         <configargs>--enable-debug=full</configargs>
    43         <builddir>debug</builddir>
    44         <ccompiler>GccOptions</ccompiler>
    45         <cxxcompiler>GppOptions</cxxcompiler>
    46         <f77compiler>G77Options</f77compiler>
    47         <cxxflags>-O0 -g3</cxxflags>
    48         <envvars/>
    49       </debug>
    50       <default>
    51         <envvars/>
    52       </default>
    53     </configurations>
    54     <make>
    55       <envvars>
    56         <envvar value="1" name="WANT_AUTOCONF_2_5" />
    57         <envvar value="1" name="WANT_AUTOMAKE_1_6" />
    58       </envvars>
    59       <abortonerror>false</abortonerror>
    60       <numberofjobs>3</numberofjobs>
    61       <dontact>false</dontact>
    62       <makebin>make</makebin>
    63       <prio>0</prio>
    64     </make>
    65   </kdevautoproject>
    66   <kdevdebugger>
    67     <general>
    68       <dbgshell>libtool</dbgshell>
    69       <programargs/>
    70       <gdbpath/>
    71       <configGdbScript/>
    72       <runShellScript/>
    73       <runGdbScript/>
    74       <breakonloadinglibs>true</breakonloadinglibs>
    75       <separatetty>false</separatetty>
    76       <floatingtoolbar>false</floatingtoolbar>
    77     </general>
    78     <display>
    79       <staticmembers>false</staticmembers>
    80       <demanglenames>true</demanglenames>
    81       <outputradix>10</outputradix>
    82     </display>
    83   </kdevdebugger>
    84   <kdevdoctreeview>
     21 </kdevdebugger>
     22 <kdevdoctreeview>
    8523    <ignoretocs>
    8624      <toc>ada</toc>
     
    12765      <toc>KDE Libraries (Doxygen)</toc>
    12866    </ignoredoxygen>
    129   </kdevdoctreeview>
     67 </kdevdoctreeview>
    13068  <kdevfilecreate>
    13169    <filetypes/>
     
    13674    </useglobaltypes>
    13775  </kdevfilecreate>
    138   <kdevcppsupport>
    139     <references/>
    140     <codecompletion>
    141       <includeGlobalFunctions>true</includeGlobalFunctions>
    142       <includeTypes>true</includeTypes>
    143       <includeEnums>true</includeEnums>
    144       <includeTypedefs>true</includeTypedefs>
    145       <automaticCodeCompletion>true</automaticCodeCompletion>
    146       <automaticArgumentsHint>true</automaticArgumentsHint>
    147       <automaticHeaderCompletion>true</automaticHeaderCompletion>
    148       <codeCompletionDelay>250</codeCompletionDelay>
    149       <argumentsHintDelay>400</argumentsHintDelay>
    150       <headerCompletionDelay>250</headerCompletionDelay>
    151     </codecompletion>
    152     <creategettersetter>
    153       <prefixGet/>
    154       <prefixSet>set</prefixSet>
    155       <prefixVariable>m_,_</prefixVariable>
    156       <parameterName>theValue</parameterName>
    157       <inlineGet>true</inlineGet>
    158       <inlineSet>true</inlineSet>
    159     </creategettersetter>
    160   </kdevcppsupport>
    161   <kdevfileview>
    162     <groups>
    163       <hidenonprojectfiles>false</hidenonprojectfiles>
    164       <hidenonlocation>false</hidenonlocation>
    165     </groups>
    166     <tree>
    167       <hidepatterns>*.o,*~</hidepatterns>
    168       <hidenonprojectfiles>false</hidenonprojectfiles>
    169     </tree>
    170   </kdevfileview>
    171   <cppsupportpart>
    172     <filetemplates>
    173       <interfacesuffix>.h</interfacesuffix>
    174       <implementationsuffix>.cc</implementationsuffix>
    175     </filetemplates>
    176   </cppsupportpart>
    177   <kdevdocumentation>
    178     <projectdoc>
    179       <docsystem/>
    180       <docurl/>
    181       <usermanualurl/>
    182     </projectdoc>
    183   </kdevdocumentation>
    184   <ctagspart>
    185     <customArguments/>
    186     <customTagfilePath/>
    187   </ctagspart>
    18876</kdevelop>
  • orxonox/branches/weaponSystem/src/story_entities/world.cc

    r4872 r4877  
    841841  while( entity != NULL )
    842842    {
    843       if( entity->bDraw ) entity->draw();
     843      if( entity->isVisible() ) entity->draw();
    844844      //entity = this->entities->nextElement();
    845845      entity = iterator->nextElement();
  • orxonox/branches/weaponSystem/src/util/loading/game_loader.cc

    r4838 r4877  
    1919#include "campaign.h"
    2020#include "world.h"
    21 #include "player.h"
    2221#include "orxonox.h"
    2322#include "camera.h"
  • orxonox/branches/weaponSystem/src/util/loading/game_loader.h

    r4836 r4877  
    11/*!
    2     \file game_loader.h
    3   *  loads campaigns, worlds and all other story_entities
     2 * @file game_loader.h
     3 *  loads campaigns, worlds and all other story_entities
    44*/
    55
     
    1818class Campaign;
    1919class World;
    20 class Camera;
    21 class CammandNode;
    2220class Factory;
    2321class TiXmlElement;
  • orxonox/branches/weaponSystem/src/world_entities/player.cc

    r4836 r4877  
    2323
    2424#include "weapon_manager.h"
    25 #include "weapon.h"
    2625#include "test_gun.h"
    2726#include "world.h"
    2827
    2928#include "list.h"
    30 #include "stdincl.h"
    3129
    3230#include "event_handler.h"
    3331
    34 #include "projectile.h"
    3532#include "event.h"
    3633
     
    4138
    4239/**
    43  *  creates a new Player
     40 * creates a new Player
    4441 * @param isFree if the player is free
    4542*/
    4643Player::Player()
    4744{
    48   /*
    49     this is the debug player - actualy we would have to make a new
    50      class derivated from Player for each player. for now, we just use
    51      the player.cc for debug also
    52   */
    5345  this->init();
    5446
     
    7567  delete this->weaponMan;
    7668}
    77 
    7869
    7970/**
     
    119110
    120111/**
    121  *
     112 * loads the Settings of a Player from an XML-element.
    122113 * @param root the XML-element to load the Player's properties from
    123114 */
     
    132123
    133124/**
    134  *  adds a weapon to the weapon list of player
     125 * adds a weapon to the weapon list of player
    135126 * @param weapon to add
    136127*/
     
    219210void Player::tick (float time)
    220211{
    221   //printf("%p\n", this);
    222   //this->getRelCoor().debug();
    223 
    224   /* link tick to weapon */
    225   //this->activeWeapon->tick(time);
    226   //this->activeWeaponL->tick(time); //FIX FIX DELETE REMOVE
    227   this->weaponMan->tick(time);
    228212  // player controlled movement
    229213  this->move(time);
     214
     215  this->weaponMan->tick(time);
    230216  // weapon system manipulation
    231   this->weapon();
     217  this->weaponAction();
    232218}
    233219
     
    266252 *  weapon manipulation by the player
    267253*/
    268 void Player::weapon()
     254void Player::weaponAction()
    269255{
    270256  if( this->bFire)
     
    277263      this->bWeaponChange = false;
    278264    }
    279 }
    280 
    281 
    282 /**
    283  *  The connection to the command node
    284  * @param cmd the Command unit from witch to map
    285 
    286    here the commands are mapped to the players movement/weaponary
    287 */
    288 void Player::command (Command* cmd)
    289 {
    290   PRINTF(3)("recieved command [%s]\n", cmd->cmd);
    291   if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_UP)) this->bUp = !cmd->bUp;
    292   if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_DOWN)) this->bDown = !cmd->bUp;
    293   if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_LEFT)) this->bLeft = !cmd->bUp;
    294   if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_RIGHT)) this->bRight = !cmd->bUp;
    295   if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_FIRE)) this->bFire = !cmd->bUp;
    296   if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_NEXT_WEAPON)) if(cmd->bUp) this->bWeaponChange = !this->bWeaponChange;
    297265}
    298266
  • orxonox/branches/weaponSystem/src/world_entities/player.h

    r4836 r4877  
    11/*!
    2     \file player.h
    3   * Implements a basic controllable WorldEntity
     2 * @file player.h
     3 * Implements a basic controllable WorldEntity
    44 */
    55
     
    1515class WeaponManager;
    1616class Vector;
    17 class World;
    1817class Event;
    19 class Crosshair;
    2018
    2119//! Basic controllable WorldEntity
     20/**
     21  *  this is the debug player - actualy we would have to make a new
     22     class derivated from Player for each player. for now, we just use
     23     the player.cc for debug also
     24*/
    2225class Player : public WorldEntity, public PhysicsInterface, public EventListener
    2326{
     
    4346    virtual void draw();
    4447
    45     virtual void command(Command* cmd);
    46 
    4748    virtual void process(const Event &event);
    4849
     
    5051  private:
    5152    void move(float time);
    52     void weapon();
     53    void weaponAction();
    5354
    5455
    5556  private:
    56     bool bUp;              //!< up button pressed.
    57     bool bDown;            //!< down button pressed.
    58     bool bLeft;            //!< left button pressed.
    59     bool bRight;           //!< right button pressed.
    60     bool bAscend;          //!< ascend button pressed.
    61     bool bDescend;         //!< descend button presses.
    62     bool bFire;            //!< fire button pressed.
    63     bool bWeaponChange;    //!< weapon change button pressed
     57    bool                  bUp;                //!< up button pressed.
     58    bool                  bDown;              //!< down button pressed.
     59    bool                  bLeft;              //!< left button pressed.
     60    bool                  bRight;             //!< right button pressed.
     61    bool                  bAscend;            //!< ascend button pressed.
     62    bool                  bDescend;           //!< descend button presses.
     63    bool                  bFire;              //!< fire button pressed.
     64    bool                  bWeaponChange;      //!< weapon change button pressed
    6465
    65     tList<Weapon>* weapons;//!< a list of weapon
    66     Weapon* activeWeapon;  //!< the weapon that is currenty activated
    67     Weapon* activeWeaponL;  //temporary -- FIX THIS
    68     WeaponManager* weaponMan; //!< the weapon manager: managing a list of weapon to wepaon-slot mapping
     66    WeaponManager*        weaponMan;          //!< the weapon manager: managing a list of weapon to wepaon-slot mapping
    6967
    70     World* myWorld;        //!< reference to the world object
    71 
    72     Vector* velocity;       //!< the velocity of the player.
    73     float travelSpeed;     //!< the current speed of the player (to make soft movement)
    74     float acceleration;    //!< the acceleration of the player.
    75 
    76     Crosshair*  crosshair; //!< the crosshair of the player
     68    Vector*               velocity;           //!< the velocity of the player.
     69    float                 travelSpeed;        //!< the current speed of the player (to make soft movement)
     70    float                 acceleration;       //!< the acceleration of the player.
    7771};
    7872
  • orxonox/branches/weaponSystem/src/world_entities/world_entity.cc

    r4836 r4877  
    3838    this->loadParams(root);
    3939
    40   this->bDraw = true;
     40  this->setVisibiliy(true);
    4141}
    4242
     
    111111*/
    112112
    113 
    114 /**
    115   *  process draw function
    116 */
    117 void WorldEntity::processDraw ()
    118 {
    119 
    120 }
    121 
    122 /**
    123  *  sets the drawable state of this entity.
    124  * @param bDraw TRUE if draweable, FALSE otherwise
    125 */
    126 void WorldEntity::setDrawable (bool bDraw)
    127 {
    128   this->bDraw = bDraw;
    129 }
    130 
    131 
    132113/**
    133114 *  this function is called, when two entities collide
     
    183164{
    184165}
    185 
    186166
    187167/**
     
    228208  glPopMatrix();
    229209}
    230 
    231 /**
    232  *  this handles incoming command messages
    233  * @param cmd: a pointer to the incoming Command structure
    234 
    235    Put all code that handles Command messages here, this will mainly be called by the assigned CommandNode but can also be used
    236    to send commands from one WorldEntity to another.
    237 */
    238 void WorldEntity::command (Command* cmd)
    239 {
    240 }
  • orxonox/branches/weaponSystem/src/world_entities/world_entity.h

    r4836 r4877  
    2626class WorldEntity : public PNode
    2727{
    28   friend class World;
    29 
    3028 public:
    3129  WorldEntity(const TiXmlElement* root = NULL);
     
    3533  void loadModel(const char* fileName);
    3634
    37   //void setCollision (CollisionCluster* newhull);
    3835
    3936  //void addAbility(Ability* ability);
    4037  //void removeAbility(Ability* ability);
    41   void setDrawable (bool bDraw);
     38
     39  /** @param visibility if the Entity should be visible (been draw) */
     40  void setVisibiliy (bool visibility) { this->bVisible = visibility; };
     41  /** @returns true if the entity is visible, false otherwise */
     42  bool isVisible() const { return this->bVisible; };
    4243  void setCharacterAttributes(CharacterAttributes* charAttr);
    4344  CharacterAttributes* getCharacterAttributes();
     
    4849  virtual void hit (WorldEntity* weapon, Vector* loc);
    4950  virtual void collideWith (WorldEntity* entity);
    50   virtual void command (Command* cmd);
    5151
    5252  /** @returns the Count of Faces on this WorldEntity */
    5353  virtual unsigned int getFaceCount () const { if (this->model) return this->model->getFaceCount(); else return 0; };
    5454
    55   void processDraw ();
    5655  virtual void draw ();
    5756  void drawBVTree(int depth, int drawMode);
     
    5958
    6059 protected:
    61   Model* model;                       //!< The model that should be loaded for this entity.
    62   CharacterAttributes* charAttr;      //!< the character attributes of a world_entity
    63   BVTree*             obbTree;       //!< this is the obb tree reference needed for collision detection
     60  Model*                  model;            //!< The model that should be loaded for this entity.
     61  CharacterAttributes*    charAttr;         //!< the character attributes of a world_entity
     62  BVTree*                 obbTree;          //!< this is the obb tree reference needed for collision detection
    6463
    6564 private:
    66   bool bCollide;                      //!< If it should be considered for the collisiontest.
    67   bool bDraw;                         //!< If it should be visible.
    68 
    69 
    70 
    71   //CollisionCluster* collisioncluster; //!< The collision-Cluster of this entity.
     65  bool                    bCollide;         //!< If it should be considered for the collisiontest.
     66  bool                    bVisible;         //!< If it should be visible.
    7267};
    7368
Note: See TracChangeset for help on using the changeset viewer.