Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4779 in orxonox.OLD for orxonox/trunk/src


Ignore:
Timestamp:
Jul 2, 2005, 10:03:59 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: created a crosshair class, that will in the future enable us to shoot at enemies

Location:
orxonox/trunk/src
Files:
3 edited
2 copied

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/Makefile.am

    r4758 r4779  
    6161                  world_entities/weapons/test_gun.cc \
    6262                  world_entities/weapons/test_bullet.cc \
     63                  world_entities/weapons/crosshair.cc \
    6364                  lib/coord/p_node.cc \
    6465                  lib/coord/null_parent.cc \
     
    112113                 world_entities/weapons/test_gun.h \
    113114                 world_entities/weapons/test_bullet.h \
     115                 world_entities/weapons/crosshair.h \
    114116                 defs/stdincl.h \
    115117                 defs/stdlibincl.h \
  • orxonox/trunk/src/Makefile.in

    r4758 r4779  
    7171        orxonox-test_entity.$(OBJEXT) orxonox-weapon.$(OBJEXT) \
    7272        orxonox-projectile.$(OBJEXT) orxonox-test_gun.$(OBJEXT) \
    73         orxonox-test_bullet.$(OBJEXT) orxonox-p_node.$(OBJEXT) \
    74         orxonox-null_parent.$(OBJEXT) \
     73        orxonox-test_bullet.$(OBJEXT) orxonox-crosshair.$(OBJEXT) \
     74        orxonox-p_node.$(OBJEXT) orxonox-null_parent.$(OBJEXT) \
    7575        orxonox-graphics_engine.$(OBJEXT) orxonox-light.$(OBJEXT) \
    7676        orxonox-text_engine.$(OBJEXT) orxonox-base_object.$(OBJEXT) \
     
    9393@AMDEP_TRUE@    ./$(DEPDIR)/orxonox-character_attributes.Po \
    9494@AMDEP_TRUE@    ./$(DEPDIR)/orxonox-class_list.Po \
     95@AMDEP_TRUE@    ./$(DEPDIR)/orxonox-crosshair.Po \
    9596@AMDEP_TRUE@    ./$(DEPDIR)/orxonox-curve.Po \
    9697@AMDEP_TRUE@    ./$(DEPDIR)/orxonox-environment.Po \
     
    306307                  world_entities/weapons/test_gun.cc \
    307308                  world_entities/weapons/test_bullet.cc \
     309                  world_entities/weapons/crosshair.cc \
    308310                  lib/coord/p_node.cc \
    309311                  lib/coord/null_parent.cc \
     
    357359                 world_entities/weapons/test_gun.h \
    358360                 world_entities/weapons/test_bullet.h \
     361                 world_entities/weapons/crosshair.h \
    359362                 defs/stdincl.h \
    360363                 defs/stdlibincl.h \
     
    470473@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-character_attributes.Po@am__quote@
    471474@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-class_list.Po@am__quote@
     475@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-crosshair.Po@am__quote@
    472476@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-curve.Po@am__quote@
    473477@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-environment.Po@am__quote@
     
    10171021@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    10181022@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-test_bullet.obj `if test -f 'world_entities/weapons/test_bullet.cc'; then $(CYGPATH_W) 'world_entities/weapons/test_bullet.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/weapons/test_bullet.cc'; fi`
     1023
     1024orxonox-crosshair.o: world_entities/weapons/crosshair.cc
     1025@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-crosshair.o -MD -MP -MF "$(DEPDIR)/orxonox-crosshair.Tpo" -c -o orxonox-crosshair.o `test -f 'world_entities/weapons/crosshair.cc' || echo '$(srcdir)/'`world_entities/weapons/crosshair.cc; \
     1026@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/orxonox-crosshair.Tpo" "$(DEPDIR)/orxonox-crosshair.Po"; else rm -f "$(DEPDIR)/orxonox-crosshair.Tpo"; exit 1; fi
     1027@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='world_entities/weapons/crosshair.cc' object='orxonox-crosshair.o' libtool=no @AMDEPBACKSLASH@
     1028@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/orxonox-crosshair.Po' tmpdepfile='$(DEPDIR)/orxonox-crosshair.TPo' @AMDEPBACKSLASH@
     1029@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1030@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-crosshair.o `test -f 'world_entities/weapons/crosshair.cc' || echo '$(srcdir)/'`world_entities/weapons/crosshair.cc
     1031
     1032orxonox-crosshair.obj: world_entities/weapons/crosshair.cc
     1033@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-crosshair.obj -MD -MP -MF "$(DEPDIR)/orxonox-crosshair.Tpo" -c -o orxonox-crosshair.obj `if test -f 'world_entities/weapons/crosshair.cc'; then $(CYGPATH_W) 'world_entities/weapons/crosshair.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/weapons/crosshair.cc'; fi`; \
     1034@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/orxonox-crosshair.Tpo" "$(DEPDIR)/orxonox-crosshair.Po"; else rm -f "$(DEPDIR)/orxonox-crosshair.Tpo"; exit 1; fi
     1035@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='world_entities/weapons/crosshair.cc' object='orxonox-crosshair.obj' libtool=no @AMDEPBACKSLASH@
     1036@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/orxonox-crosshair.Po' tmpdepfile='$(DEPDIR)/orxonox-crosshair.TPo' @AMDEPBACKSLASH@
     1037@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1038@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-crosshair.obj `if test -f 'world_entities/weapons/crosshair.cc'; then $(CYGPATH_W) 'world_entities/weapons/crosshair.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/weapons/crosshair.cc'; fi`
    10191039
    10201040orxonox-p_node.o: lib/coord/p_node.cc
  • orxonox/trunk/src/defs/class_id.h

    r4754 r4779  
    7777  CL_MASK_LOWLEVEL_CLASS  =    0x00000fff,
    7878
    79   // singleton classes (range from 0x00000f01 to 0x00000fff)
     79  // singleton classes (range from 0x00000f00 to 0x00000fff)
    8080  CL_MASK_SINGLETON       =    0x00000f00,
    8181  CL_ORXONOX              =    0x00000f01,
     
    102102
    103103
    104   // StoryEntities (range from 0x00000101 to 0x000001ff)
     104  // StoryEntities (range from 0x00000100 to 0x000001ff)
    105105  CL_CAMPAIGN             =    0x00000101,
    106106  CL_WORLD                =    0x00000102,
    107107
    108108
    109   // WorldEntities (range from 0x00000201 to 0x000004ff)
     109  // WorldEntities (range from 0x00000200 to 0x000004ff)
    110110  CL_CAMERA               =    0x00000201,
    111111  CL_CAMERA_TARGET        =    0x00000202,
     
    124124  CL_EVENT                =    0x00000501,
    125125  CL_KEY_MAPPER           =    0x00000502,
     126  CL_CROSSHAIR            =    0x0000050f,
    126127
    127128  CL_WEAPON_MANAGER       =    0x00000503,
  • orxonox/trunk/src/world_entities/weapons/crosshair.cc

    r4774 r4779  
    1010
    1111   ### File Specific:
    12    main-programmer: ...
     12   main-programmer: Benjamin Grauer
    1313   co-programmer: ...
    1414*/
     
    1616//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
    1717
    18 #include "proto_class.h"
     18#include "crosshair.h"
    1919
    2020using namespace std;
     
    2525   \todo this constructor is not jet implemented - do it
    2626*/
    27 ProtoClass::ProtoClass ()
     27Crosshair::Crosshair ()
    2828{
    29    this->setClassID(CL_PROTO_ID, "ProtoClass");
     29  this->setClassID(CL_CROSSHAIR, "Crosshair");
     30  this->setName("Crosshair");
    3031
    31    /* If you make a new class, what is most probably the case when you write this file
    32       don't forget to:
    33        1. Add the new file new_class.cc to the ./src/Makefile.am
    34        2. Add the class identifier to ./src/class_id.h eg. CL_NEW_CLASS
    35 
    36       Advanced Topics:
    37       - if you want to let your object be managed via the ObjectManager make sure to read
    38         the object_manager.h header comments. You will use this most certanly only if you
    39         make many objects of your class, like a weapon bullet.
    40    */
    4132}
    4233
     
    4637
    4738*/
    48 ProtoClass::~ProtoClass ()
     39Crosshair::~Crosshair ()
    4940{
    5041  // delete what has to be deleted here
    5142}
     43
     44void Crosshair::process(const Event &event)
     45{
     46
     47
     48}
  • orxonox/trunk/src/world_entities/weapons/crosshair.h

    r4774 r4779  
    1 /*! 
    2     \file proto_class.h
     1/*!
     2    \file crosshair.h
    33    \brief Definition of ...
    44
    55*/
    66
    7 #ifndef _PROTO_CLASS_H
    8 #define _PROTO_CLASS_H
     7#ifndef _CROSSHAIR_H
     8#define _CROSSHAIR_H
    99
    10 #include "base_object.h"
     10#include "event_listener.h"
     11
     12#include "vector.h"
    1113
    1214// FORWARD DEFINITION
    1315
    1416
    15 
    16 //! A class for ...
    17 class ProtoClass : public BaseObject {
     17//! A class that enables the
     18class Crosshair : public EventListener {
    1819
    1920 public:
    20   ProtoClass();
    21   virtual ~ProtoClass();
     21  Crosshair();
     22  virtual ~Crosshair();
    2223
    2324
     25  virtual void process(const Event &event);
     26
     27  /** @returns the current 3D-position of the Crosshair */
     28  const Vector& getPosition() { return this->position; };
     29
     30  void tick(float dt);
     31  void draw();
     32
    2433 private:
     34   Vector           position;             //!< The current position of the Crosshair
    2535
    2636};
    2737
    28 #endif /* _PROTO_CLASS_H */
     38#endif /* _CROSSHAIR_H */
Note: See TracChangeset for help on using the changeset viewer.