Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4293 in orxonox.OLD


Ignore:
Timestamp:
May 26, 2005, 10:34:14 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/physics: intoducing state: stors the Camera position globally somewhere we have to store this data

Location:
orxonox/branches/physics/src
Files:
8 edited
2 copied

Legend:

Unmodified
Added
Removed
  • orxonox/branches/physics/src/Makefile.am

    r4291 r4293  
    6060                 util/loading/factory.cc \
    6161                 util/loading/load_param.cc \
     62                 util/state.cc \
    6263                 story_entities/story_entity.cc \
    6364                 story_entities/campaign.cc \
     
    116117                 util/object_manager.h \
    117118                 util/garbage_collector.h \
     119                 util/state.h \
    118120                 story_entities/story_entity.h \
    119121                 story_entities/story_def.h \
  • orxonox/branches/physics/src/Makefile.in

    r4291 r4293  
    6060        garbage_collector.$(OBJEXT) list.$(OBJEXT) \
    6161        resource_manager.$(OBJEXT) factory.$(OBJEXT) \
    62         load_param.$(OBJEXT) story_entity.$(OBJEXT) campaign.$(OBJEXT) \
    63         world.$(OBJEXT) world_entity.$(OBJEXT) camera.$(OBJEXT) \
    64         player.$(OBJEXT) environment.$(OBJEXT) skysphere.$(OBJEXT) \
    65         skybox.$(OBJEXT) terrain.$(OBJEXT) weapon.$(OBJEXT) \
    66         projectile.$(OBJEXT) satellite.$(OBJEXT) \
     62        load_param.$(OBJEXT) state.$(OBJEXT) story_entity.$(OBJEXT) \
     63        campaign.$(OBJEXT) world.$(OBJEXT) world_entity.$(OBJEXT) \
     64        camera.$(OBJEXT) player.$(OBJEXT) environment.$(OBJEXT) \
     65        skysphere.$(OBJEXT) skybox.$(OBJEXT) terrain.$(OBJEXT) \
     66        weapon.$(OBJEXT) projectile.$(OBJEXT) satellite.$(OBJEXT) \
    6767        character_attributes.$(OBJEXT) test_gun.$(OBJEXT) \
    6868        test_bullet.$(OBJEXT) test_entity.$(OBJEXT) p_node.$(OBJEXT) \
     
    112112@AMDEP_TRUE@    ./$(DEPDIR)/resource_manager.Po \
    113113@AMDEP_TRUE@    ./$(DEPDIR)/satellite.Po ./$(DEPDIR)/skybox.Po \
    114 @AMDEP_TRUE@    ./$(DEPDIR)/skysphere.Po \
     114@AMDEP_TRUE@    ./$(DEPDIR)/skysphere.Po ./$(DEPDIR)/state.Po \
    115115@AMDEP_TRUE@    ./$(DEPDIR)/story_entity.Po \
    116116@AMDEP_TRUE@    ./$(DEPDIR)/substring.Po ./$(DEPDIR)/terrain.Po \
     
    274274                 util/loading/factory.cc \
    275275                 util/loading/load_param.cc \
     276                 util/state.cc \
    276277                 story_entities/story_entity.cc \
    277278                 story_entities/campaign.cc \
     
    330331                 util/object_manager.h \
    331332                 util/garbage_collector.h \
     333                 util/state.h \
    332334                 story_entities/story_entity.h \
    333335                 story_entities/story_def.h \
     
    512514@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/skybox.Po@am__quote@
    513515@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/skysphere.Po@am__quote@
     516@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/state.Po@am__quote@
    514517@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/story_entity.Po@am__quote@
    515518@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/substring.Po@am__quote@
     
    750753@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    751754@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o load_param.obj `if test -f 'util/loading/load_param.cc'; then $(CYGPATH_W) 'util/loading/load_param.cc'; else $(CYGPATH_W) '$(srcdir)/util/loading/load_param.cc'; fi`
     755
     756state.o: util/state.cc
     757@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT state.o -MD -MP -MF "$(DEPDIR)/state.Tpo" -c -o state.o `test -f 'util/state.cc' || echo '$(srcdir)/'`util/state.cc; \
     758@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/state.Tpo" "$(DEPDIR)/state.Po"; else rm -f "$(DEPDIR)/state.Tpo"; exit 1; fi
     759@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/state.cc' object='state.o' libtool=no @AMDEPBACKSLASH@
     760@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/state.Po' tmpdepfile='$(DEPDIR)/state.TPo' @AMDEPBACKSLASH@
     761@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     762@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o state.o `test -f 'util/state.cc' || echo '$(srcdir)/'`util/state.cc
     763
     764state.obj: util/state.cc
     765@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT state.obj -MD -MP -MF "$(DEPDIR)/state.Tpo" -c -o state.obj `if test -f 'util/state.cc'; then $(CYGPATH_W) 'util/state.cc'; else $(CYGPATH_W) '$(srcdir)/util/state.cc'; fi`; \
     766@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/state.Tpo" "$(DEPDIR)/state.Po"; else rm -f "$(DEPDIR)/state.Tpo"; exit 1; fi
     767@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/state.cc' object='state.obj' libtool=no @AMDEPBACKSLASH@
     768@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/state.Po' tmpdepfile='$(DEPDIR)/state.TPo' @AMDEPBACKSLASH@
     769@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     770@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o state.obj `if test -f 'util/state.cc'; then $(CYGPATH_W) 'util/state.cc'; else $(CYGPATH_W) '$(srcdir)/util/state.cc'; fi`
    752771
    753772story_entity.o: story_entities/story_entity.cc
  • orxonox/branches/physics/src/lib/graphics/particles/particle_system.cc

    r4193 r4293  
    2020#include "particle_emitter.h"
    2121#include "particle_engine.h"
     22
     23#include "field.h"
     24
    2225#include "compiler.h"
    2326#include "material.h"
    24 
    25 #include "field.h"
     27#include "state.h"
     28
    2629
    2730// needed to find the Position of the Camera
    2831#include "world.h"
    29 #include "camera.h"
    3032
    3133using namespace std;
     
    337339          //! \todo implement a faster code for the look-at Camera algorithm.
    338340
    339           Camera* camera = WorldInterface::getInstance()->getCurrentWorld()->getLocalCamera();  //!< \todo MUST be different
     341          const PNode* camera = State::getInstance()->getCamera();  //!< \todo MUST be different
    340342          Vector cameraPos = camera->getAbsCoor();
    341           Vector cameraTargetPos = camera->getTarget()->getAbsCoor();
     343          Vector cameraTargetPos = State::getInstance()->getCameraTarget()->getAbsCoor();
    342344          Vector view = cameraTargetPos - cameraPos;
    343345          Vector up = Vector(0, 1, 0);
  • orxonox/branches/physics/src/story_entities/world.cc

    r4283 r4293  
    2121
    2222#include "orxonox.h"
     23
     24#include "state.h"
    2325
    2426#include "p_node.h"
     
    203205  this->debugWorldNr = worldID;
    204206  this->entities = new tList<WorldEntity>();
     207 
     208  State::getInstance();
    205209}
    206210
     
    282286  this->localCamera = new Camera();
    283287  this->localCamera->setName ("camera");
    284  
     288
     289  State::getInstance()->setCamera(this->localCamera, this->localCamera->getTarget());
     290
    285291  GraphicsEngine::getInstance()->displayFPS(true);
    286292}
  • orxonox/branches/physics/src/subprojects/particles/Makefile.am

    r4292 r4293  
    1414AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/util
    1515AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/math
     16AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/physics
     17AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/physics/fields
    1618AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/tinyxml
    1719AM_CXXFLAGS+=-I$(MAINSRCDIR)/defs
     
    3032AM_LDFLAGS=$(MWINDOWS)
    3133
    32 bin_PROGRAMS=importer
     34bin_PROGRAMS = particles
    3335
     36particles_LDADD = $(MAINSRCDIR)/lib/physics/libORXphysics.a
    3437
    35 importer_SOURCES= framework.cc \
     38particles_SOURCES= framework.cc \
     39                  $(MAINSRCDIR)/lib/graphics/particles/particle_engine.cc \
     40                  $(MAINSRCDIR)/lib/graphics/particles/particle_system.cc \
     41                  $(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc \
     42                  $(MAINSRCDIR)/util/state.cc \
    3643                  $(MAINSRCDIR)/lib/graphics/importer/model.cc \
    3744                  $(MAINSRCDIR)/lib/graphics/importer/objModel.cc \
     
    4855                  $(MAINSRCDIR)/lib/coord/null_parent.cc
    4956
    50 noinst_HEADERS = framework.h 
     57noinst_HEADERS = framework.h
  • orxonox/branches/physics/src/subprojects/particles/Makefile.in

    r4292 r4293  
    1616
    1717
    18 SOURCES = $(importer_SOURCES)
     18SOURCES = $(particles_SOURCES)
    1919
    2020srcdir = @srcdir@
     
    3939POST_UNINSTALL = :
    4040host_triplet = @host@
    41 bin_PROGRAMS = importer$(EXEEXT)
     41bin_PROGRAMS = particles$(EXEEXT)
    4242subdir = src/subprojects/particles
    4343DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
     
    5353binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
    5454PROGRAMS = $(bin_PROGRAMS)
    55 am_importer_OBJECTS = framework.$(OBJEXT) model.$(OBJEXT) \
    56         objModel.$(OBJEXT) primitive_model.$(OBJEXT) array.$(OBJEXT) \
    57         material.$(OBJEXT) texture.$(OBJEXT) graphics_engine.$(OBJEXT) \
     55am_particles_OBJECTS = framework.$(OBJEXT) particle_engine.$(OBJEXT) \
     56        particle_system.$(OBJEXT) particle_emitter.$(OBJEXT) \
     57        state.$(OBJEXT) model.$(OBJEXT) objModel.$(OBJEXT) \
     58        primitive_model.$(OBJEXT) array.$(OBJEXT) material.$(OBJEXT) \
     59        texture.$(OBJEXT) graphics_engine.$(OBJEXT) \
    5860        base_object.$(OBJEXT) vector.$(OBJEXT) \
    5961        resource_manager.$(OBJEXT) text_engine.$(OBJEXT) \
    6062        p_node.$(OBJEXT) null_parent.$(OBJEXT)
    61 importer_OBJECTS = $(am_importer_OBJECTS)
    62 importer_LDADD = $(LDADD)
     63particles_OBJECTS = $(am_particles_OBJECTS)
     64particles_DEPENDENCIES = $(MAINSRCDIR)/lib/physics/libORXphysics.a
    6365DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
    6466depcomp = $(SHELL) $(top_srcdir)/depcomp
     
    7173@AMDEP_TRUE@    ./$(DEPDIR)/null_parent.Po ./$(DEPDIR)/objModel.Po \
    7274@AMDEP_TRUE@    ./$(DEPDIR)/p_node.Po \
     75@AMDEP_TRUE@    ./$(DEPDIR)/particle_emitter.Po \
     76@AMDEP_TRUE@    ./$(DEPDIR)/particle_engine.Po \
     77@AMDEP_TRUE@    ./$(DEPDIR)/particle_system.Po \
    7378@AMDEP_TRUE@    ./$(DEPDIR)/primitive_model.Po \
    7479@AMDEP_TRUE@    ./$(DEPDIR)/resource_manager.Po \
    75 @AMDEP_TRUE@    ./$(DEPDIR)/text_engine.Po ./$(DEPDIR)/texture.Po \
    76 @AMDEP_TRUE@    ./$(DEPDIR)/vector.Po
     80@AMDEP_TRUE@    ./$(DEPDIR)/state.Po ./$(DEPDIR)/text_engine.Po \
     81@AMDEP_TRUE@    ./$(DEPDIR)/texture.Po ./$(DEPDIR)/vector.Po
    7782CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
    7883        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     
    8085CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
    8186        -o $@
    82 SOURCES = $(importer_SOURCES)
    83 DIST_SOURCES = $(importer_SOURCES)
     87SOURCES = $(particles_SOURCES)
     88DIST_SOURCES = $(particles_SOURCES)
    8489HEADERS = $(noinst_HEADERS)
    8590ETAGS = etags
     
    195200target_vendor = @target_vendor@
    196201MAINSRCDIR = ../..
    197 AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/graphics/particles -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/gui/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/lib/tinyxml -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai -I$(MAINSRCDIR)/util -I$(MAINSRCDIR)/util/animation -I$(MAINSRCDIR)/util/common -I$(MAINSRCDIR)/util/loading -I$(MAINSRCDIR)/util/track -I$(MAINSRCDIR)/subprojects
     202AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/graphics/particles -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/gui/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/lib/physics -I$(MAINSRCDIR)/lib/physics/fields -I$(MAINSRCDIR)/lib/tinyxml -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai -I$(MAINSRCDIR)/util -I$(MAINSRCDIR)/util/animation -I$(MAINSRCDIR)/util/common -I$(MAINSRCDIR)/util/loading -I$(MAINSRCDIR)/util/track -I$(MAINSRCDIR)/subprojects
    198203AM_LDFLAGS = $(MWINDOWS)
    199 importer_SOURCES = framework.cc \
     204particles_LDADD = $(MAINSRCDIR)/lib/physics/libORXphysics.a
     205particles_SOURCES = framework.cc \
     206                  $(MAINSRCDIR)/lib/graphics/particles/particle_engine.cc \
     207                  $(MAINSRCDIR)/lib/graphics/particles/particle_system.cc \
     208                  $(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc \
     209                  $(MAINSRCDIR)/util/state.cc \
    200210                  $(MAINSRCDIR)/lib/graphics/importer/model.cc \
    201211                  $(MAINSRCDIR)/lib/graphics/importer/objModel.cc \
     
    212222                  $(MAINSRCDIR)/lib/coord/null_parent.cc
    213223
    214 noinst_HEADERS = framework.h 
     224noinst_HEADERS = framework.h
    215225all: all-am
    216226
     
    269279clean-binPROGRAMS:
    270280        -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
    271 importer$(EXEEXT): $(importer_OBJECTS) $(importer_DEPENDENCIES)
    272         @rm -f importer$(EXEEXT)
    273         $(CXXLINK) $(importer_LDFLAGS) $(importer_OBJECTS) $(importer_LDADD) $(LIBS)
     281particles$(EXEEXT): $(particles_OBJECTS) $(particles_DEPENDENCIES)
     282        @rm -f particles$(EXEEXT)
     283        $(CXXLINK) $(particles_LDFLAGS) $(particles_OBJECTS) $(particles_LDADD) $(LIBS)
    274284
    275285mostlyclean-compile:
     
    288298@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objModel.Po@am__quote@
    289299@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_node.Po@am__quote@
     300@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/particle_emitter.Po@am__quote@
     301@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/particle_engine.Po@am__quote@
     302@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/particle_system.Po@am__quote@
    290303@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/primitive_model.Po@am__quote@
    291304@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resource_manager.Po@am__quote@
     305@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/state.Po@am__quote@
    292306@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text_engine.Po@am__quote@
    293307@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@
     
    309323@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    310324@am__fastdepCXX_FALSE@  $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
     325
     326particle_engine.o: $(MAINSRCDIR)/lib/graphics/particles/particle_engine.cc
     327@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT particle_engine.o -MD -MP -MF "$(DEPDIR)/particle_engine.Tpo" -c -o particle_engine.o `test -f '$(MAINSRCDIR)/lib/graphics/particles/particle_engine.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/particles/particle_engine.cc; \
     328@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/particle_engine.Tpo" "$(DEPDIR)/particle_engine.Po"; else rm -f "$(DEPDIR)/particle_engine.Tpo"; exit 1; fi
     329@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/particles/particle_engine.cc' object='particle_engine.o' libtool=no @AMDEPBACKSLASH@
     330@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/particle_engine.Po' tmpdepfile='$(DEPDIR)/particle_engine.TPo' @AMDEPBACKSLASH@
     331@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     332@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_engine.o `test -f '$(MAINSRCDIR)/lib/graphics/particles/particle_engine.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/particles/particle_engine.cc
     333
     334particle_engine.obj: $(MAINSRCDIR)/lib/graphics/particles/particle_engine.cc
     335@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT particle_engine.obj -MD -MP -MF "$(DEPDIR)/particle_engine.Tpo" -c -o particle_engine.obj `if test -f '$(MAINSRCDIR)/lib/graphics/particles/particle_engine.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/particles/particle_engine.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/particles/particle_engine.cc'; fi`; \
     336@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/particle_engine.Tpo" "$(DEPDIR)/particle_engine.Po"; else rm -f "$(DEPDIR)/particle_engine.Tpo"; exit 1; fi
     337@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/particles/particle_engine.cc' object='particle_engine.obj' libtool=no @AMDEPBACKSLASH@
     338@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/particle_engine.Po' tmpdepfile='$(DEPDIR)/particle_engine.TPo' @AMDEPBACKSLASH@
     339@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     340@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_engine.obj `if test -f '$(MAINSRCDIR)/lib/graphics/particles/particle_engine.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/particles/particle_engine.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/particles/particle_engine.cc'; fi`
     341
     342particle_system.o: $(MAINSRCDIR)/lib/graphics/particles/particle_system.cc
     343@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT particle_system.o -MD -MP -MF "$(DEPDIR)/particle_system.Tpo" -c -o particle_system.o `test -f '$(MAINSRCDIR)/lib/graphics/particles/particle_system.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/particles/particle_system.cc; \
     344@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/particle_system.Tpo" "$(DEPDIR)/particle_system.Po"; else rm -f "$(DEPDIR)/particle_system.Tpo"; exit 1; fi
     345@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/particles/particle_system.cc' object='particle_system.o' libtool=no @AMDEPBACKSLASH@
     346@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/particle_system.Po' tmpdepfile='$(DEPDIR)/particle_system.TPo' @AMDEPBACKSLASH@
     347@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     348@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_system.o `test -f '$(MAINSRCDIR)/lib/graphics/particles/particle_system.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/particles/particle_system.cc
     349
     350particle_system.obj: $(MAINSRCDIR)/lib/graphics/particles/particle_system.cc
     351@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT particle_system.obj -MD -MP -MF "$(DEPDIR)/particle_system.Tpo" -c -o particle_system.obj `if test -f '$(MAINSRCDIR)/lib/graphics/particles/particle_system.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/particles/particle_system.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/particles/particle_system.cc'; fi`; \
     352@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/particle_system.Tpo" "$(DEPDIR)/particle_system.Po"; else rm -f "$(DEPDIR)/particle_system.Tpo"; exit 1; fi
     353@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/particles/particle_system.cc' object='particle_system.obj' libtool=no @AMDEPBACKSLASH@
     354@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/particle_system.Po' tmpdepfile='$(DEPDIR)/particle_system.TPo' @AMDEPBACKSLASH@
     355@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     356@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_system.obj `if test -f '$(MAINSRCDIR)/lib/graphics/particles/particle_system.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/particles/particle_system.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/particles/particle_system.cc'; fi`
     357
     358particle_emitter.o: $(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc
     359@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT particle_emitter.o -MD -MP -MF "$(DEPDIR)/particle_emitter.Tpo" -c -o particle_emitter.o `test -f '$(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc; \
     360@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/particle_emitter.Tpo" "$(DEPDIR)/particle_emitter.Po"; else rm -f "$(DEPDIR)/particle_emitter.Tpo"; exit 1; fi
     361@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc' object='particle_emitter.o' libtool=no @AMDEPBACKSLASH@
     362@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/particle_emitter.Po' tmpdepfile='$(DEPDIR)/particle_emitter.TPo' @AMDEPBACKSLASH@
     363@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     364@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_emitter.o `test -f '$(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc
     365
     366particle_emitter.obj: $(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc
     367@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT particle_emitter.obj -MD -MP -MF "$(DEPDIR)/particle_emitter.Tpo" -c -o particle_emitter.obj `if test -f '$(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc'; fi`; \
     368@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/particle_emitter.Tpo" "$(DEPDIR)/particle_emitter.Po"; else rm -f "$(DEPDIR)/particle_emitter.Tpo"; exit 1; fi
     369@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc' object='particle_emitter.obj' libtool=no @AMDEPBACKSLASH@
     370@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/particle_emitter.Po' tmpdepfile='$(DEPDIR)/particle_emitter.TPo' @AMDEPBACKSLASH@
     371@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     372@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_emitter.obj `if test -f '$(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc'; fi`
     373
     374state.o: $(MAINSRCDIR)/util/state.cc
     375@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT state.o -MD -MP -MF "$(DEPDIR)/state.Tpo" -c -o state.o `test -f '$(MAINSRCDIR)/util/state.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/util/state.cc; \
     376@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/state.Tpo" "$(DEPDIR)/state.Po"; else rm -f "$(DEPDIR)/state.Tpo"; exit 1; fi
     377@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/util/state.cc' object='state.o' libtool=no @AMDEPBACKSLASH@
     378@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/state.Po' tmpdepfile='$(DEPDIR)/state.TPo' @AMDEPBACKSLASH@
     379@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     380@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o state.o `test -f '$(MAINSRCDIR)/util/state.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/util/state.cc
     381
     382state.obj: $(MAINSRCDIR)/util/state.cc
     383@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT state.obj -MD -MP -MF "$(DEPDIR)/state.Tpo" -c -o state.obj `if test -f '$(MAINSRCDIR)/util/state.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/util/state.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/util/state.cc'; fi`; \
     384@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/state.Tpo" "$(DEPDIR)/state.Po"; else rm -f "$(DEPDIR)/state.Tpo"; exit 1; fi
     385@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/util/state.cc' object='state.obj' libtool=no @AMDEPBACKSLASH@
     386@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/state.Po' tmpdepfile='$(DEPDIR)/state.TPo' @AMDEPBACKSLASH@
     387@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     388@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o state.obj `if test -f '$(MAINSRCDIR)/util/state.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/util/state.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/util/state.cc'; fi`
    311389
    312390model.o: $(MAINSRCDIR)/lib/graphics/importer/model.cc
  • orxonox/branches/physics/src/subprojects/particles/framework.cc

    r4283 r4293  
    1616#include "framework.h"
    1717
    18 #include "vector.h"
    19 
    20 #include "primitive_model.h"
     18#include "physics_engine.h"
     19#include "particle_engine.h"
     20
    2121#include "debug.h"
    2222#include "graphics_engine.h"
     
    2525
    2626int verbose;
    27 void DrawGLScene()
    28 {
    29   currFrame = SDL_GetTicks();
    30   dt = currFrame - lastFrame;
    31   if (dt == 0)
    32     dist += (zoomTo-dist)/500;
    33   else
    34     dist += (zoomTo-dist)/500 *(float)dt;
    35 
    36   rotatorP += rotatorV *(float)dt;
     27
     28bool mainLoop()
     29{
     30  while(true)
     31    {
     32      if (!keyHandler())
     33        return false;
     34
     35      // Draw the scene
     36      draw();
     37     
     38    }
     39
     40}
     41
     42
     43bool draw()
     44{
    3745 
    3846
     
    4553    gluLookAt (0, dist , dist, 0,0,0, up.x,up.y,up.z);
    4654
    47   glMatrixMode(GL_MODELVIEW);
    48   glPushMatrix();
    49   //  glRotatef (180, dir.x, dir.y, dir.z);
    50   glMultMatrixf (*matQ);
    51   if (obj)
    52     obj->draw();
    53 
    54   glPopMatrix();
     55
    5556
    5657  SDL_GL_SwapBuffers(); // Swap the buffers
     58
     59}
     60bool tick()
     61{
     62  currFrame = SDL_GetTicks();
     63  float dt = (float)(currFrame - lastFrame) /1000.0;
     64  if (dt == 0)
     65    dist += (zoomTo-dist);
     66  else
     67    dist += (zoomTo-dist) *(float)dt;
     68  rotatorP += rotatorV *(float)dt;
     69
     70  ParticleEngine::getInstance()->tick(dt);
     71
    5772  lastFrame = currFrame;
    58 }
    59 
    60 
    61 int main(int argc, char *argv[])
    62 {
    63   verbose = 3;
    64 
    65   Uint8* keys; // This variable will be used in the keyboard routine
    66   int done = false; // We aren't done yet, are we?
    67 
    68   // Create a new OpenGL window with the title "Cone3D Basecode" at
    69   // 640x480x32, fullscreen and check for errors along the way
    70   GraphicsEngine::getInstance();
    71 
    72   if (argc>=3)
    73     obj = new OBJModel (argv[1], atof(argv[2]));
    74   else if (argc>=2)
    75     obj = new OBJModel(argv[1]);
    76   else
    77     obj = new PrimitiveModel(CYLINDER);
    78 
    79   M = Vector(GraphicsEngine::getInstance()->getResolutionY()/2, GraphicsEngine::getInstance()->getResolutionX()/2, 0);
    80   rotAxis = Vector (0.0,1.0,0.0);
    81   rotAngle = 0;
    82 
    83   matQ[0][0] = matQ[1][1] = matQ[2][2] = matQ[3][3] = 1;
    84   rotQ = Quaternion (rotAngle, rotAxis);
    85   rotQlast = rotQ;
    86   dir = Vector (0.0, 0.0, 1.0);
    87   up = Vector (0.0, 1.0, 0.0);
    88 
    89   glEnable(GL_LIGHTING);
    90   glEnable(GL_DEPTH_TEST);
    91 
    92   GLfloat whiteLight[] = {1.0, 1.0, 1.0,1.0};
    93   GLfloat light0Position[] = {10.0, 10.0, 10.0, 0.0};
    94   GLfloat light1Position[] = {-10.0, -7.0, -6.0, 0.0};
    95   GLfloat lmodelAmbient[] = {.1, .1, .1, 1.0};
    96 
    97   glEnable(GL_LIGHT0);
    98   glLightfv(GL_LIGHT0, GL_POSITION, light0Position);
    99   glLightfv(GL_LIGHT0, GL_DIFFUSE, whiteLight);
    100   glLightfv(GL_LIGHT0, GL_SPECULAR, whiteLight);
    101  
    102   glEnable(GL_LIGHT1);
    103   glLightfv(GL_LIGHT1, GL_POSITION, light1Position);
    104   glLightfv(GL_LIGHT1, GL_DIFFUSE, whiteLight);
    105   glLightfv(GL_LIGHT1, GL_SPECULAR, whiteLight);
    106  
    107 
    108   glEnable(GL_TEXTURE_2D);
    109   rotatorP = .0;
    110   rotatorV = .0;
    111   dist = 5.0;
    112   zoomTo = dist;
    113   // Build the font from a TGA image font.tga in the data directory
    114   // Hide the mouse cursor
    115     SDL_ShowCursor(2);
    116     mouse1Down = false;
    117 
     73 
     74}
     75
     76
     77bool keyHandler()
     78{
    11879  // This is the main loop for the entire program and it will run until done==TRUE
    119   while(!done)
    12080  {
    121     // Draw the scene
    122     DrawGLScene();
    12381    // And poll for events
    12482    SDL_Event event;
     
    210168          {
    211169          case SDLK_x:
    212             delete obj;
    213             obj = NULL;
     170
    214171            break;
    215172          case SDLK_c:
    216             if (!obj)
    217               obj = new OBJModel(argv[1]);
     173
    218174            break;
    219175          case SDLK_a:
     
    229185      case SDL_QUIT:
    230186        // then we're done and we'll end this program
    231           done=true;
    232           break;
     187        return false;
     188        break;
    233189      default:
    234           break;
     190        break;
    235191      }
    236 
    237192
    238193    }
     
    242197
    243198    // and check if ESCAPE has been pressed. If so then quit
    244     if(keys[SDLK_ESCAPE]) done=true;
     199    if(keys[SDLK_ESCAPE]) return false;
    245200  }
    246 
     201  return true;
     202}
     203
     204
     205int main(int argc, char *argv[])
     206{
     207  verbose = 3;
     208
     209
     210  // Create a new OpenGL window with the title "Cone3D Basecode" at
     211  // 640x480x32, fullscreen and check for errors along the way
     212  GraphicsEngine::getInstance();
     213
     214 
     215
     216  M = Vector(GraphicsEngine::getInstance()->getResolutionY()/2, GraphicsEngine::getInstance()->getResolutionX()/2, 0);
     217  rotAxis = Vector (0.0,1.0,0.0);
     218  rotAngle = 0;
     219
     220  matQ[0][0] = matQ[1][1] = matQ[2][2] = matQ[3][3] = 1;
     221  rotQ = Quaternion (rotAngle, rotAxis);
     222  rotQlast = rotQ;
     223  dir = Vector (0.0, 0.0, 1.0);
     224  up = Vector (0.0, 1.0, 0.0);
     225
     226  glEnable(GL_LIGHTING);
     227  glEnable(GL_DEPTH_TEST);
     228
     229  GLfloat whiteLight[] = {1.0, 1.0, 1.0,1.0};
     230  GLfloat light0Position[] = {10.0, 10.0, 10.0, 0.0};
     231  GLfloat light1Position[] = {-10.0, -7.0, -6.0, 0.0};
     232  GLfloat lmodelAmbient[] = {.1, .1, .1, 1.0};
     233
     234  glEnable(GL_LIGHT0);
     235  glLightfv(GL_LIGHT0, GL_POSITION, light0Position);
     236  glLightfv(GL_LIGHT0, GL_DIFFUSE, whiteLight);
     237  glLightfv(GL_LIGHT0, GL_SPECULAR, whiteLight);
     238 
     239  glEnable(GL_LIGHT1);
     240  glLightfv(GL_LIGHT1, GL_POSITION, light1Position);
     241  glLightfv(GL_LIGHT1, GL_DIFFUSE, whiteLight);
     242  glLightfv(GL_LIGHT1, GL_SPECULAR, whiteLight);
     243 
     244
     245  glEnable(GL_TEXTURE_2D);
     246  rotatorP = .0;
     247  rotatorV = .0;
     248  dist = 5.0;
     249  zoomTo = dist;
     250  // Build the font from a TGA image font.tga in the data directory
     251  // Hide the mouse cursor
     252  SDL_ShowCursor(2);
     253  mouse1Down = false;
     254
     255  mainLoop();
     256   
    247257  // Kill the GL & SDL screens
    248   if (obj)
    249     delete obj;
     258
    250259  delete GraphicsEngine::getInstance();
    251260  // And quit
  • orxonox/branches/physics/src/subprojects/particles/framework.h

    r4283 r4293  
    22#define _FRAMEWORK_H
    33 
    4 #include "objModel.h"
    54#include "vector.h"
     5#include "glincl.h"
    66
    77float rotatorP;
     
    1313Uint32 lastFrame;
    1414Uint32 currFrame;
    15 Uint32 dt;
    16 
    1715
    1816Vector dir;
     
    2927Quaternion rotQlast;
    3028
     29Uint8* keys; // This variable will be used in the keyboard routine
    3130bool mouse1Down;
    3231
    33 Model* obj;
    34 
     32bool mainLoop();
     33bool draw();
     34bool tick();
     35bool keyHandler();
    3536
    3637#endif /* _FRAMEWORK_H */
  • orxonox/branches/physics/src/util/state.cc

    r4289 r4293  
    1010
    1111   ### File Specific:
    12    main-programmer: ...
     12   main-programmer: Benjamin Grauer
    1313   co-programmer: ...
    1414*/
     
    1616//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
    1717
    18 #include "proto_singleton.h"
     18#include "state.h"
    1919
    2020using namespace std;
     
    2424   \brief standard constructor
    2525*/
    26 ProtoSingleton::ProtoSingleton ()
     26State::State ()
    2727{
    28    this->setClassName ("ProtoSingleton");
     28   this->setClassName ("State");
    2929
     30   this->camera = NULL;
     31   this->cameraTarget = NULL;
    3032}
    3133
     
    3335   \brief the singleton reference to this class
    3436*/
    35 ProtoSingleton* ProtoSingleton::singletonRef = NULL;
     37State* State::singletonRef = NULL;
    3638
    3739/**
    3840   \returns a Pointer to this Class
    3941*/
    40 ProtoSingleton* ProtoSingleton::getInstance(void)
     42State* State::getInstance(void)
    4143{
    42   if (!ProtoSingleton::singletonRef)
    43     ProtoSingleton::singletonRef = new ProtoSingleton();
    44   return ProtoSingleton::singletonRef;
     44  if (!State::singletonRef)
     45    State::singletonRef = new State();
     46  return State::singletonRef;
    4547}
    4648
     
    4951
    5052*/
    51 ProtoSingleton::~ProtoSingleton ()
     53State::~State ()
    5254{
    53   ProtoSingleton::singletonRef = NULL;
     55  State::singletonRef = NULL;
    5456
    5557}
     58
     59/**
     60   \sets camera and target of the current Camera
     61*/
     62void State::setCamera(const PNode* camera, const PNode* cameraTarget)
     63{
     64  this->camera = camera;
     65  this->cameraTarget = cameraTarget;
     66}
  • orxonox/branches/physics/src/util/state.h

    r4289 r4293  
    11/*!
    22    \file proto_singleton.h
    3     \brief Definition of the ... singleton Class
     3    \brief Definition of the States-singleton Class
    44   
    55*/
    66
    7 #ifndef _PROTO_SINGLETON_H
    8 #define _PROTO_SINGLETON_H
     7#ifndef _STATE_H
     8#define _STATE_H
    99
    1010#include "base_object.h"
    1111
    1212// FORWARD DEFINITION
     13class PNode;
    1314
    14 //! A default singleton class.
    15 class ProtoSingleton : public BaseObject {
     15//! A Singleton class, that handles some states about orxonox's objects
     16class State : public BaseObject {
    1617
    1718 public:
    18   static ProtoSingleton* getInstance(void);
    19   virtual ~ProtoSingleton(void);
     19  static State* getInstance(void);
     20  virtual ~State(void);
     21
     22  void setCamera(const PNode* camera, const PNode* cameraTarget);
     23  const PNode* getCamera(void) const { return this->camera; };
     24  const PNode* getCameraTarget(void) const { return this->cameraTarget; };
    2025
    2126 private:
    22   ProtoSingleton(void);
    23   static ProtoSingleton* singletonRef;
     27  State(void);
     28  static State* singletonRef;
     29
     30  const PNode* camera;
     31  const PNode* cameraTarget;
    2432};
    2533
    26 #endif /* _PROTO_SINGLETON_H */
     34#endif /* _STATE_H */
Note: See TracChangeset for help on using the changeset viewer.