Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9160 in orxonox.OLD


Ignore:
Timestamp:
Jul 4, 2006, 5:53:06 PM (18 years ago)
Author:
patrick
Message:

aimin system work on and on and…

Location:
branches/presentation/src/world_entities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/world_entities/creatures/fps_player.cc

    r9158 r9160  
    256256    attitude-= yMouse;
    257257
    258     PRINTF(0)("attitude: %f\n", attitude);
    259258
    260259    if ( attitude > 0.32 )
  • branches/presentation/src/world_entities/weapons/aiming_system.cc

    r9157 r9160  
    1919
    2020#include "util/loading/load_param.h"
    21 #include "graphics_engine.h"
     21
    2222#include "state.h"
    23 #include "material.h"
    24 #include "t_animation.h"
    25 #include "text.h"
    2623
    27 #include "world_entity.h"
     24#include <vector>
     25
    2826
    2927using namespace std;
     
    7674
    7775
     76/**
     77 * get back the nearest target
     78 */
     79inline WorldEntity* AimingSystem::getNearestTarget()
     80{
     81  if( this->selectionList.size() == 0)
     82    return NULL;
     83  else if( this->selectionList.size() == 1)
     84    return this->selectionList.back();
     85
     86//   WorldEntity* nearestEntity = this->;
     87
     88  for( int i = 0; i < this->selectionList.size(); i++)
     89  {
     90
     91  }
     92}
     93
     94
     95/**
     96 * called when an object is "selected"
     97 *  @param damage damage to be dealt
     98 *  @param killer the entity
     99 */
     100void AimingSystem::hit(float damage, WorldEntity* killer)
     101{
     102  this->selectionList.push_back(killer);
     103}
     104
     105
    78106
    79107/**
  • branches/presentation/src/world_entities/weapons/aiming_system.h

    r9157 r9160  
    77#define _AIMING_SYSTEM_H
    88
    9 #include "p_node.h"
    10 #include "element_2d.h"
    11 #include "object_manager.h"
     9
     10#include "world_entity.h"
     11
     12
    1213
    1314// FORWARD DECLARATION
    1415class TiXmlElement;
     16class BVTree;
     17class Model;
    1518
    1619
    17 
    18 class AimingSystem : public PNode
     20class AimingSystem : public WorldEntity
    1921{
    2022
     
    3032  inline PNode* getTarget(PNode* target) { return this->getParent(); };
    3133
     34  inline WorldEntity* getNearestTarget();
     35
    3236
    3337  void setRange(float range){this->range = range;};
    34   void setGroup(OM_LIST group){this->group = group;};
    3538
     39  void hit(float damage, WorldEntity* killer);
    3640
    3741  virtual void tick(float dt);
     
    4044
    4145 private:
    42    float            range;                //!<
    43    OM_LIST          group;
     46   float                       range;                //!<
     47   std::vector<WorldEntity*>   selectionList;        //!< the selections
     48
    4449
    4550};
Note: See TracChangeset for help on using the changeset viewer.