Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9166 in orxonox.OLD


Ignore:
Timestamp:
Jul 4, 2006, 7:28:41 PM (18 years ago)
Author:
patrick
Message:

more aiming system work. nothing visible yet

Location:
branches/presentation/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/lib/collision_reaction/cr_object_damage.cc

    r9061 r9166  
    5656  float damage = 0.0f;
    5757
    58   PRINTF(0)("Dealing damage - Handling collision: %s vs %s\n",
     58  PRINTF(5)("Dealing damage - Handling collision: %s vs %s\n",
    5959            collision->getEntityA()->getClassName(),
    6060            collision->getEntityB()->getClassName());
  • branches/presentation/src/world_entities/creatures/fps_player.cc

    r9163 r9166  
    3232
    3333#include "aabb.h"
     34
    3435
    3536#include "key_mapper.h"
     
    9091  this->bJump = false;
    9192  this->bPosBut = false;
     93  this->bFire = false;
    9294
    9395  this->xMouse = 0.0f;
     
    143145  this->getWeaponManager().getFixedTarget()->setRelCoor(1000,0,0);
    144146
     147  this->aimingSystem = new AimingSystem();
     148  this->addChild(this->aimingSystem);
     149  this->aimingSystem->toList(OM_LIST(this->getOMListNumber() + 1));
     150
    145151
    146152  // network registration
     
    245251
    246252
    247 
    248 
    249   Playable::tick( time );
     253  this->getWeaponManager().tick(time);
     254  if( this->bFire)
     255  {
     256    this->getWeaponManager().fire();
     257
     258    WorldEntity* target = this->aimingSystem->getNearestTarget();
     259    if( target != NULL)
     260    {
     261      PRINTF(0)("hit hit hit, got: %s\n", target->getClassName());
     262    }
     263    else
     264    {
     265      PRINTF(0)("nothing hit\n");
     266    }
     267  }
     268
     269
     270
    250271
    251272  if( ( xMouse != 0 || yMouse != 0 ) && (this->getOwner() == SharedNetworkData::getInstance()->getHostID() || !State::isOnline() ) )
     
    407428  }
    408429  else if( event.type == KeyMapper::PEV_JUMP)
     430  {
    409431    this->bJump = event.bPressed;
     432  }
     433  else if( event.type == KeyMapper::PEV_FIRE1)
     434  {
     435    this->bFire = event.bPressed;
     436  }
    410437}
    411438
     
    420447{
    421448  Playable::destroy( killer );
    422  
     449
    423450  toList( OM_DEAD );
    424451}
  • branches/presentation/src/world_entities/creatures/fps_player.h

    r9163 r9166  
    4848    bool                  bJump;              //!< jumping
    4949    bool                  bPosBut;             //!< position button
     50    bool                  bFire;              //!< fire button
    5051
    5152    float                 xMouse;             //!< mouse moved in x-Direction
  • branches/presentation/src/world_entities/weapons/aiming_system.cc

    r9163 r9166  
    2121
    2222#include "state.h"
     23
     24#include "aabb.h"
    2325
    2426#include <vector>
     
    5557  this->setClassID(CL_CROSSHAIR, "AimingSystem");
    5658  this->setName("AimingSystem");
     59
     60  this->loadModel("models/guns/targeting_system_body.obj");
    5761}
    5862
     
    7882 * @returns the nerest target
    7983 */
    80 inline WorldEntity* AimingSystem::getNearestTarget()
     84WorldEntity* AimingSystem::getNearestTarget()
    8185{
    8286  if( this->selectionList.size() == 0)
     
    132136void AimingSystem::draw() const
    133137{
     138//   if( this->getModelAABB() != NULL)
     139//     this->getModelAABB()->drawBV(0, 1);
    134140}
  • branches/presentation/src/world_entities/weapons/aiming_system.h

    r9160 r9166  
    3232  inline PNode* getTarget(PNode* target) { return this->getParent(); };
    3333
    34   inline WorldEntity* getNearestTarget();
     34  WorldEntity* getNearestTarget();
    3535
    3636
  • branches/presentation/src/world_entities/world_entity.h

    r9162 r9166  
    7575  inline BVTree* getOBBTree() const { return this->obbTree; };
    7676  void drawBVTree(int depth, int drawMode) const;
    77   inline AABB* getModelAABB() { return (this->aabbNode)?this->aabbNode->getAABB():NULL;}
     77  inline AABB* getModelAABB() const { return (this->aabbNode)?this->aabbNode->getAABB():NULL;}
    7878
    7979  /* --- Collision Reaction Block --- */
     
    198198  int                     list_write;                      //!< entity's list
    199199  int                     list_handle;                     //!< handle for list changes
    200  
     200
    201201  float                   health_write;
    202202  int                     health_handle;
    203  
     203
    204204  float                   healthMax_write;
    205205  int                     healthMax_handle;
Note: See TracChangeset for help on using the changeset viewer.