Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4959 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons


Ignore:
Timestamp:
Jul 27, 2005, 6:07:47 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: orxonox runs again (the TrackManager produces speed)

Location:
orxonox/trunk/src/world_entities/weapons
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/weapons/test_gun.cc

    r4955 r4959  
    164164  if (target != NULL)
    165165  {
    166     target->debugDraw();
    167     Vector test = ((target->getAbsCoor() - this->getAbsCoor())*5);
    168     pj->setVelocity(test/20.0);//this->getVelocity());
     166    pj->setVelocity(this->getVelocity()+(target->getAbsCoor() - this->getAbsCoor())*.5);//this->getVelocity());
    169167  }
    170168  else
  • orxonox/trunk/src/world_entities/weapons/test_gun.h

    r4955 r4959  
    2626#include "weapon.h"
    2727
     28
     29//! a weapon can be left or right sided
     30/**
     31 * @todo this will be reset with mirror X/Y/Z
     32 */
     33#define    W_LEFT        0
     34#define    W_RIGHT       1
     35
     36
    2837class TestGun : public Weapon
    2938  {
  • orxonox/trunk/src/world_entities/weapons/weapon.cc

    r4955 r4959  
    5656    if (this->soundBuffers[i])
    5757      ResourceManager::getInstance()->unload(this->soundBuffers[i]);
     58
     59  if (ClassList::exists(this->soundSource, CL_SOUND_SOURCE))
     60    delete this->soundSource;
    5861}
    5962
  • orxonox/trunk/src/world_entities/weapons/weapon.h

    r4955 r4959  
    11/*!
    2     \file weapon.h
    3   *  a weapon that a  can use
    4 
    5 
    6     A weapon is characterized by:
    7      o firing-rate: the initial firing rate of a weapon (1/s = Herz)
    8      o slowdown-factor: this is a factor d: exp(-d*x), d is element of all positive R. it determines how fast the firing-rate will slow down. if no slowdown: d=0, the bigger d is, the faster the weapon will slow down!
    9      o energy-consumption: this determines the energy that has to be used to produce this projectile = costs per projectile
    10 
    11     Furthermore there are some other attributes, that will help to represent a firing
    12     weapon in this world:
    13      o sound file/ressource: this is a pointer to the sound-file/ressource. however it may be represented
    14      o animations
    15 */
     2 * @file weapon.h
     3 *
     4 * Weapon is the mayor baseclass for all weapons. it is quite extensive, and expensive in use,
     5 * because each weapon will know virutal functions for the WorldEntity's part, and also virtuals
     6 * for Fireing/Reloading/...,
     7 * quickly said: Weapon is a wrapper for weapons, that makes it easy to very quickly implement
     8 * new Weapons, and with them make this game better, than any game before it, because still
     9 * Weapons (GUNS) are the most important thing in life :?... no to be serious
     10 * @see Weapon
     11 */
    1612
    1713
     
    5652} WeaponState;
    5753
    58 
    59 //! a weapon can be left or right sided
    60 /**
    61  * @todo this will be reset with mirror X/Y/Z
    62  */
    63 #define    W_LEFT        0
    64 #define    W_RIGHT       1
     54//! an enumerator defining capabilities of a WeaponSlot
     55typedef enum
     56{
     57  WTYPE_DIRECTIONAL   = 0x00000001,           //!< Weapon is directional/Slot is able to carry directional weapons
     58  WTYPE_TURRET        = 0x00000002,           //!< Weapon is a turret/slot is able to carry turrets
     59  WTYPE_ALLKINDS      = 0x0000000f,           //!< Weapon is all types/Slot is able to carry all kinds of weapons
     60
     61  WTYPE_FORWARD       = 0x00000010,           //!< Weapon fires forwards/Slot is able to carry weapons firing forwards
     62  WTYPE_BACKWARD      = 0x00000020,           //!< Weapon fires backwards/Slot is able to carry weapons firing backwards
     63  WTYPE_LEFT          = 0x00000040,           //!< Weapon fires to the left/Slot is able to carry weapons firing to the left
     64  WTYPE_RIGHT         = 0x00000080,           //!< Weapon fires to the right/Slot is able to carry weapons firing to the right
     65  WTYPE_ALLDIRS       = 0x000000f0,           //!< Weapon has no specific firing direction/Slot can fire into all directions
     66
     67  WTYPE_ALL           = 0x000000ff,           //!< Weapon has no limitations/Slot can handle all kinds of Weapon.
     68} W_Capability;
    6569
    6670//! An abstract class, that describes weapons
  • orxonox/trunk/src/world_entities/weapons/weapon_manager.cc

    r4954 r4959  
    7373  for (int i = 0; i < WM_MAX_SLOTS; i++)
    7474  {
    75     this->currentSlotConfig[i].capability = WM_SLOTC_ALL;
     75    this->currentSlotConfig[i].capability = WTYPE_ALL;
    7676    this->currentSlotConfig[i].currentWeapon = NULL;
    7777    this->currentSlotConfig[i].nextWeapon = NULL;
  • orxonox/trunk/src/world_entities/weapons/weapon_manager.h

    r4955 r4959  
    1313#include "base_object.h"
    1414
    15 #include "p_node.h"
    1615#include "crosshair.h"
     16#include "weapon.h"
    1717
    1818// FORWARD DECLARATION
    19 class PNode;
    20 class Weapon;
    2119template <class T> class tAnimation;
    2220
     
    2523#define    WM_MAX_CONFIGS          4              //!< The maximum number of predefined Configurations
    2624#define    WM_MAX_LOADED_WEAPONS   20             //!< The
    27 
    28 //! an enumerator defining capabilities of a WeaponSlot
    29 typedef enum
    30 {
    31   WM_SLOTC_DIRECTIONAL   = 0x00000001,           //!< if the Slot is able to carry directional weapons
    32   WM_SLOTC_TURRET        = 0x00000002,           //!< if the Slot is able to carry turrets
    33   WM_SLOTC_ALLKINDS      = 0x0000000f,           //!< if the Slot is able to carry all kinds of weapons
    34 
    35   WM_SLOTC_FORWARD       = 0x00000010,           //!< if the Slot is able to carry weapons firing forward
    36   WM_SLOTC_BACKWARD      = 0x00000020,           //!< if the Slot is able to carry weapons firing backwards
    37   WM_SLOTC_LEFT          = 0x00000040,           //!< if the Slot is able to carry weapons firing to the left
    38   WM_SLOTC_RIGHT         = 0x00000080,           //!< if the Slot is able to carry weapons firing to the right
    39   WM_SLOTC_ALLDIRS       = 0x000000f0,           //!< this slot can fire into all directions
    40 
    41   WM_SLOTC_ALL           = 0x000000ff,           //!< everything allowed in this slot
    42 } WM_SlotCapability;
    4325
    4426//! an enumerator defining a Slot, where a Weapon can be stored inside.
Note: See TracChangeset for help on using the changeset viewer.