Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4837 in orxonox.OLD


Ignore:
Timestamp:
Jul 12, 2005, 3:11:57 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: derivation of superclasses is more clear now. lets see, if this will hold out for some time (about 115 classes long)

Location:
orxonox/trunk/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/defs/class_id.h

    r4836 r4837  
    4040 * The number has 8^4 entries.
    4141 * The first two: 1,2 superclass identifiers to
    42  * The second three are for subclasses with inheritance
    43  * These two may not be the same in any way,
     42 * The second three are for subclasses with inheritance:
     43 * the first of these numbers is defining the subclassType, it may be anything between 1-a
     44 * The following two may not be the same in any way,
    4445 * eg. the bits may not intersect (no 1, 2 and a 3; 1,2 and 4 would be ok)
    4546 * The last three entries are for any classes in existence eg. SkyBox and so on
    4647 *
    47  * @todo complete this List
    48 */
     48 * -> # max SuperClass-count        = 7 (not intersecting)
     49 *    # max SubSuperClass-count     = 15*7 = 105 (the 7 classes will be able to get derived from each other, but not over the SubSuperClass.)
     50 *    # max lowerClasses-count      = 3^16 = enough (they are Leaves, and may NOT be derived by any other class.)
     51 */
    4952typedef enum ClassID
    5053{
    5154  // the Nothing CLASS (NULL)
    52   CL_NULL                 =    0x00000000,
     55  CL_NULL                       =    0x00000000,
    5356
    5457  // superclasses
    55   CL_MASK_SUPER_CLASS     =    0xff000000,
    56   CL_BASE_OBJECT          =    0x01000000,
     58  CL_MASK_SUPER_CLASS           =    0xff000000,
     59  CL_BASE_OBJECT                =    0x01000000,
    5760
    58   CL_PARENT_NODE          =    0x02000000,
    59   CL_WORLD_ENTITY         =    0x04000000,
     61  CL_PARENT_NODE                =    0x02000000,
     62  CL_WORLD_ENTITY               =    0x04000000,
    6063
    61   CL_STORY_ENTITY         =    0x08000000,
     64  CL_STORY_ENTITY               =    0x08000000,
    6265
    63   CL_PHYSICS_INTERFACE    =    0x10000000,
     66  CL_PHYSICS_INTERFACE          =    0x10000000,
    6467
    65   CL_EVENT_LISTENER       =    0x20000000,
     68  CL_EVENT_LISTENER             =    0x20000000,
    6669
    6770  // subsuper-classes
    68   CL_MASK_SUBSUPER_CLASS  =    0x00fff000,
    69   CL_PLAYER               =    0x00001000,
    70   CL_NPC                  =    0x00002000,
    71   CL_POWER_UP             =    0x00004000,
    72   CL_FIELD                =    0x00008000,
    73   CL_PROJECTILE           =    0x00010000,
    74   CL_WEAPON               =    0x00020000,
     71  CL_MASK_SUBSUPER_CLASS        =    0x00fff000,
     72  CL_MASK_SUBSUPER_CLASS_ID     =    0x00f00000,
     73  CL_MASK_SUBSUPER_CLASS_ID2    =    0x000ff000,
     74  CL_PLAYER                     =    0x00101000,
     75  CL_NPC                        =    0x00102000,
     76  CL_POWER_UP                   =    0x00104000,
     77  CL_FIELD                      =    0x00108000,
     78  CL_PROJECTILE                 =    0x00110000,
     79  CL_WEAPON                     =    0x00120000,
    7580
    7681  // lowest level classes
    77   CL_MASK_LOWLEVEL_CLASS  =    0x00000fff,
     82  CL_MASK_LOWLEVEL_CLASS        =    0x00000fff,
    7883
    7984  // singleton classes (range from 0x00000f00 to 0x00000fff)
    80   CL_MASK_SINGLETON       =    0x00000f00,
    81   CL_ORXONOX              =    0x00000f01,
    82   CL_NULL_PARENT          =    0x00000f02,
    83   CL_PILOT_PARENT         =    0x00000f03,
    84   CL_OBJECT_MANAGER       =    0x00000f04,
    85   CL_RESOURCE_MANAGER     =    0x00000f05,
    86   CL_GARBAGE_COLLECTOR    =    0x00000f06,
    87   CL_GAME_LOADER          =    0x00000f07,
    88   CL_GRAPHICS_ENGINE      =    0x00000f08,
    89   CL_TEXT_ENGINE          =    0x00000f09,
    90   CL_LIGHT_MANAGER        =    0x00000f0a,
    91   CL_EVENT_HANDLER        =    0x00000f0b,
    92   CL_PHYSICS_ENGINE       =    0x00000f0c,
    93   CL_CD_ENGINE            =    0x00000f0d,
    94   CL_PARTICLE_ENGINE      =    0x00000f0e,
    95   CL_SOUND_ENGINE         =    0x00000f0f,
    96   CL_ANIMATION_PLAYER     =    0x00000f10,
    97   CL_TRACK_MANAGER        =    0x00000f11,
    98   CL_TRACK_NODE           =    0x00000f12,
    99   CL_STATE                =    0x00000f13,
    100   CL_FRAMEWORK            =    0x00000f14,
     85  CL_MASK_SINGLETON             =    0x00000f00,
     86  CL_ORXONOX                    =    0x00000f01,
     87  CL_NULL_PARENT                =    0x00000f02,
     88  CL_PILOT_PARENT               =    0x00000f03,
     89  CL_OBJECT_MANAGER             =    0x00000f04,
     90  CL_RESOURCE_MANAGER           =    0x00000f05,
     91  CL_GARBAGE_COLLECTOR          =    0x00000f06,
     92  CL_GAME_LOADER                =    0x00000f07,
     93  CL_GRAPHICS_ENGINE            =    0x00000f08,
     94  CL_TEXT_ENGINE                =    0x00000f09,
     95  CL_LIGHT_MANAGER              =    0x00000f0a,
     96  CL_EVENT_HANDLER              =    0x00000f0b,
     97  CL_PHYSICS_ENGINE             =    0x00000f0c,
     98  CL_CD_ENGINE                  =    0x00000f0d,
     99  CL_PARTICLE_ENGINE            =    0x00000f0e,
     100  CL_SOUND_ENGINE               =    0x00000f0f,
     101  CL_ANIMATION_PLAYER           =    0x00000f10,
     102  CL_TRACK_MANAGER              =    0x00000f11,
     103  CL_TRACK_NODE                 =    0x00000f12,
     104  CL_STATE                      =    0x00000f13,
     105  CL_FRAMEWORK                  =    0x00000f14,
    101106
    102107
    103108
    104109  // StoryEntities (range from 0x00000100 to 0x000001ff)
    105   CL_CAMPAIGN             =    0x00000101,
    106   CL_WORLD                =    0x00000102,
     110  CL_CAMPAIGN                   =    0x00000101,
     111  CL_WORLD                      =    0x00000102,
    107112
    108113
    109114  // WorldEntities (range from 0x00000200 to 0x000004ff)
    110   CL_CAMERA               =    0x00000201,
    111   CL_CAMERA_TARGET        =    0x00000202,
     115  CL_CAMERA                     =    0x00000201,
     116  CL_CAMERA_TARGET              =    0x00000202,
    112117
    113   CL_ENVIRONEMENT         =    0x00000203,
    114   CL_SATELLITE            =    0x00000204,
    115   CL_SKYBOX               =    0x00000205,
    116   CL_SKYSPHERE            =    0x00000206,
    117   CL_TERRAIN              =    0x00000207,
    118   CL_TEST_BULLET          =    0x00000208,
    119   CL_TEST_ENTITY          =    0x00000209,
    120   CL_TEST_GUN             =    0x0000020a,
     118  CL_ENVIRONEMENT               =    0x00000203,
     119  CL_SATELLITE                  =    0x00000204,
     120  CL_SKYBOX                     =    0x00000205,
     121  CL_SKYSPHERE                  =    0x00000206,
     122  CL_TERRAIN                    =    0x00000207,
     123  CL_TEST_BULLET                =    0x00000208,
     124  CL_TEST_ENTITY                =    0x00000209,
     125  CL_TEST_GUN                   =    0x0000020a,
    121126
    122127
    123128  // gamePlay (range from 0x00000500 0x000005ff)
    124   CL_EVENT                =    0x00000501,
    125   CL_KEY_MAPPER           =    0x00000502,
    126   CL_CROSSHAIR            =    0x0000050f,
     129  CL_EVENT                      =    0x00000501,
     130  CL_KEY_MAPPER                 =    0x00000502,
     131  CL_CROSSHAIR                  =    0x0000050f,
    127132
    128   CL_WEAPON_MANAGER       =    0x00000503,
     133  CL_WEAPON_MANAGER             =    0x00000503,
    129134
    130135  // Physics stuff (range from 0x00000600 to 0x000007ff)
    131   CL_PHYSICS_CONNECTION   =    0x00000601,
    132   CL_FIELD_GRAVITY        =    0x00000610,
    133   CL_FIELD_POINT_GRAVITY  =    0x00000611,
    134   CL_FIELD_TWIRL          =    0x00000612,
     136  CL_PHYSICS_CONNECTION         =    0x00000601,
     137  CL_FIELD_GRAVITY              =    0x00000610,
     138  CL_FIELD_POINT_GRAVITY        =    0x00000611,
     139  CL_FIELD_TWIRL                =    0x00000612,
    135140
    136141
    137142  // Collision
    138   CL_COLLISION            =    0x00000611,
    139   CL_BV_TREE              =    0x00000612,
    140   CL_BV_TREE_NODE         =    0x00000613,
    141   CL_OBB_TREE             =    0x00000614,
    142   CL_OBB_TREE_NODE        =    0x00000615,
    143   CL_BOUNDING_VOLUME      =    0x00000616,
    144   CL_OBB                  =    0x00000617,
    145   CL_BOUNDING_SPHERE      =    0x00000618,
     143  CL_COLLISION                  =    0x00000611,
     144  CL_BV_TREE                    =    0x00a01612,
     145  CL_BV_TREE_NODE               =    0x00a02613,
     146  CL_OBB_TREE                   =    0x00a04614,
     147  //! @todo !!!!THIS IS A HACK!!!!! DELETE THESE extensions.
     148  CL_OBB_TREE_NODE              =    0x00a08615,
     149  CL_BOUNDING_VOLUME            =    0x00a10616,
     150  CL_OBB                        =    0x00a20617,
     151  CL_BOUNDING_SPHERE            =    0x00a40618,
    146152
    147153  // graphical stuff (range from 0x00000800 to 0x000009ff)
    148   CL_TEXT                 =    0x00000801,
    149   CL_FONT                 =    0x00000802,
    150   CL_MATERIAL             =    0x00000803,
    151   CL_MODEL                =    0x00000804, //!< @todo make this a SUBCLASS maybe
    152   CL_OBJMODEL             =    0x00000805,
    153   CL_PROMITIVE_MODEL      =    0x00000806,
    154   CL_MD2Model             =    0x00000807,
    155   CL_LIGHT                =    0x00000808,
    156   CL_PARTICLE_EMITTER     =    0x00000809,
    157   CL_PARTICLE_SYSTEM      =    0x0000080a,
    158   CL_ENVIRONMENT          =    0x00000810,
     154  CL_TEXT                       =    0x00000801,
     155  CL_FONT                       =    0x00000802,
     156  CL_MATERIAL                   =    0x00000803,
     157  CL_MODEL                      =    0x00000804, //!< @todo make this a SUBCLASS maybe
     158  CL_OBJMODEL                   =    0x00000805,
     159  CL_PROMITIVE_MODEL            =    0x00000806,
     160  CL_MD2Model                   =    0x00000807,
     161  CL_LIGHT                      =    0x00000808,
     162  CL_PARTICLE_EMITTER           =    0x00000809,
     163  CL_PARTICLE_SYSTEM            =    0x0000080a,
     164  CL_ENVIRONMENT                =    0x00000810,
    159165  // GL-menu
    160   CL_GLMENU_IMAGE_SCREEN  =    0x00000901,
     166  CL_GLMENU_IMAGE_SCREEN        =    0x00000901,
    161167
    162168  // sound stuff (range from 0x00000a00 to 0x00000aff)
    163   CL_SOUND_BUFFER         =    0x00000a01,
    164   CL_SOUND_SOURCE         =    0x00000a02,
     169  CL_SOUND_BUFFER               =    0x00000a01,
     170  CL_SOUND_SOURCE               =    0x00000a02,
    165171
    166172
    167173  // misc: (range from 0x00000b00 to 0x00000cff)
    168   CL_ANIMATION            =    0x00000b01,
    169   //  CL_ANIMATION3D          =    0x00000b02,
    170   CL_QUICK_ANIMATION      =    0x00000b02,
    171   CL_FACTORY              =    0x00000b03,
    172   CL_INI_PARSER           =    0x00000b04,
    173   CL_LIST                 =    0x00000b05,
    174   CL_SUBSTRING            =    0x00000b06,
    175   CL_LOAD_PARAM           =    0x00000b07,
    176   CL_CURVE                =    0x00000b08,
    177   CL_VECTOR               =    0x00000b09,
    178   CL_CHARACTER_ATTRIBUTES =    0x00000b0a,
    179   CL_TRACK_ELEMENT        =    0x00000b0b,
    180   CL_NUMBER               =    0x00000b0c,
     174  CL_ANIMATION                  =    0x00000b01,
     175  //  CL_ANIMATION3D                =    0x00000b02,
     176  CL_QUICK_ANIMATION            =    0x00000b02,
     177  CL_FACTORY                    =    0x00000b03,
     178  CL_INI_PARSER                 =    0x00000b04,
     179  CL_LIST                       =    0x00000b05,
     180  CL_SUBSTRING                  =    0x00000b06,
     181  CL_LOAD_PARAM                 =    0x00000b07,
     182  CL_CURVE                      =    0x00000b08,
     183  CL_VECTOR                     =    0x00000b09,
     184  CL_CHARACTER_ATTRIBUTES       =    0x00000b0a,
     185  CL_TRACK_ELEMENT              =    0x00000b0b,
     186  CL_NUMBER                     =    0x00000b0c,
    181187
    182188
    183189  // Spatial Data Separation
    184   CL_SPATIAL_SEPARATION   =    0x00000b0d,
    185   CL_QUADTREE             =    0x00000b0e,
    186   CL_QUADTREE_NODE        =    0x00000b0f
     190  CL_SPATIAL_SEPARATION         =    0x00000b0d,
     191  CL_QUADTREE                   =    0x00000b0e,
     192  CL_QUADTREE_NODE              =    0x00000b0f
    187193};
    188194
  • orxonox/trunk/src/lib/lang/base_object.cc

    r4836 r4837  
    103103bool BaseObject::isA (long classID) const
    104104{
    105   // if classID is a derivable object
    106   if ( likely(classID & CL_MASK_SUPER_CLASS || classID & CL_MASK_SUBSUPER_CLASS))
     105  // if classID is a derivable object from a SUPERCLASS
     106  if (classID & CL_MASK_SUPER_CLASS)
    107107  {
    108     if( this->classID & classID)
     108    if( likely(this->classID & classID))
    109109      return true;
    110   } // if classID is a LOWLEVEL-class
     110  }
     111  // if classID is a SubSuperClass, and
     112  else if (classID & CL_MASK_SUBSUPER_CLASS)
     113  {
     114    if (likely(((this->classID & CL_MASK_SUBSUPER_CLASS_ID) == (this->classID & CL_MASK_SUBSUPER_CLASS_ID)) &&
     115        this->classID & classID & CL_MASK_SUBSUPER_CLASS_ID2))
     116      return true;
     117  }
     118  // if classID is a LOWLEVEL-class
    111119  else
    112120  {
    113     if( (this->classID & CL_MASK_LOWLEVEL_CLASS) == classID)
     121    if( likely((this->classID & CL_MASK_LOWLEVEL_CLASS) == classID))
    114122      return true;
    115123  }
  • orxonox/trunk/src/orxonox.cc

    r4836 r4837  
    7272
    7373  this->configFileName = NULL;
    74 
    7574}
    7675
  • orxonox/trunk/src/story_entities/world.cc

    r4836 r4837  
    183183
    184184  delete WorldInterface::getInstance();
     185  delete this->entities;
    185186  delete NullParent::getInstance();
    186   delete this->entities;
    187187  State::setWorldEntityList(NULL);
    188188
     
    10891089  this->draw();
    10901090  // draw HUD
    1091   /* @todo draw HUD */
     1091  /** @todo draw HUD */
    10921092  // flip buffers
    10931093  GraphicsEngine::swapBuffers();
  • orxonox/trunk/src/util/animation/animation.h

    r4836 r4837  
    8888  virtual void rewind() = 0;
    8989
    90   /** \brief A virtual function that ticks the animation @param dt the time passed */
     90  /** A virtual function that ticks the animation @param dt the time passed */
    9191  virtual void tick(float dt) = 0;
    9292
     
    124124 public:
    125125  inline aTest() { last = 0.0;}
    126   /** \brief a little debug information to show the results of this class @param f new value */
     126  /** a little debug information to show the results of this class @param f new value */
    127127  inline void littleDebug(float f) {  diff = f - last; printf("f=%f, diff=%f\n", f,diff); last = f;}
    128128 private:
  • orxonox/trunk/src/util/animation/t_animation.h

    r4836 r4837  
    6161
    6262
    63   //  ANIM_FUNCTION animFunc;
     63  //  ANIM_FUNCTION animFunc
    6464  float (tAnimation<T>::*animFunc)(float) const;  //!< A Function for the AnimationType
    6565
  • orxonox/trunk/src/world_entities/weapons/weapon_manager.cc

    r4834 r4837  
    2525#include "vector.h"
    2626#include "list.h"
     27#include "t_animation.h"
    2728
    2829using namespace std;
     
    7677  this->currConfID = W_CONFIG0;
    7778  this->crosshair = new Crosshair();
    78 }
    79 
    80 /**
    81  *
     79
     80  this->crossHairSizeAnim = new tAnimation<Crosshair>(this->crosshair, &Crosshair::setSize);
     81  this->crossHairSizeAnim->setInfinity(ANIM_INF_REWIND);
     82  this->crossHairSizeAnim->addKeyFrame(50, .1, ANIM_LINEAR);
     83  this->crossHairSizeAnim->addKeyFrame(100, .05, ANIM_LINEAR);
     84  this->crossHairSizeAnim->addKeyFrame(50, .01, ANIM_LINEAR);
     85}
     86
     87/**
     88 * loads the settings of the WeaponManager
    8289 * @param root the XML-element to load from
    8390 */
     
    207214
    208215
    209 
    210216/**
    211217 * triggers fire of all weapons in the current weaponconfig
     
    219225    if( firingWeapon != NULL) firingWeapon->fire();
    220226  }
    221   this->crosshair->setRotationSpeed(-500);
     227  this->crosshair->setRotationSpeed(500);
     228  this->crossHairSizeAnim->replay();
    222229}
    223230
  • orxonox/trunk/src/world_entities/weapons/weapon_manager.h

    r4836 r4837  
    3333class Weapon;
    3434class Crosshair;
     35template <class T> class tAnimation;
    3536
    3637#define    W_MAX_SLOTS       8
     
    5758
    5859//! this is a weapon Configuration: it has up to 8 slots
    59 typedef struct weaponConfig
     60typedef struct
    6061{
    6162  bool           bUsed;                       //!< is set to true, if this configuration is
    6263  Weapon*        slots[8];
    63 };
     64} weaponConfig;
    6465
    6566
     
    8586
    8687  private:
    87     Crosshair*            crosshair;               //!< an aim.
     88    int getNextFreeSlot(int configID);
    8889
    89     int                   nrOfSlots;               //<! number of weapon slots a ship has
    90     int                   currConfID;              //<! the currently selected config
    91     weaponConfig          configs[4];              //<! a list of four configurations
     90  private:
     91    Crosshair*              crosshair;               //!< an aim.
     92    tAnimation<Crosshair>*  crossHairSizeAnim;
    9293
    93     int getNextFreeSlot(int configID);
     94    int                     nrOfSlots;               //<! number of weapon slots a ship has
     95    int                     currConfID;              //<! the currently selected config
     96    weaponConfig            configs[4];              //<! a list of four configurations
     97
    9498};
Note: See TracChangeset for help on using the changeset viewer.