Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3966 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Apr 26, 2005, 12:23:38 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: merged branches/particleEngine into the trunk, because of the new vector class
merged with command:
svn merge -r 3922:HEAD particleEngine/ ../trunk/

not merged src/story_entities/world.cc. will do this at a later time (do not forget)

Location:
orxonox/trunk/src
Files:
2 deleted
17 edited
7 copied

Legend:

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

    r3869 r3966  
    88AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics
    99AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/importer
     10AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/particles
    1011AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/gui
    1112AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/lang
     
    6970                 lib/graphics/importer/material.cc \
    7071                 lib/graphics/importer/texture.cc \
     72                 lib/graphics/particles/particle_engine.cc \
     73                 lib/graphics/particles/particle_system.cc \
     74                 lib/graphics/particles/particle_emitter.cc \
    7175                 lib/lang/base_entity.cc \
    7276                 lib/lang/base_object.cc \
     
    125129                 lib/graphics/light.h \
    126130                 lib/graphics/text_engine.h \
     131                 lib/graphics/particles/particle_engine.h \
     132                 lib/graphics/particles/particle_system.h \
     133                 lib/graphics/particles/particle_emitter.h \
    127134                 lib/data/data_tank.h \
    128135                 lib/lang/base_entity.h \
  • orxonox/trunk/src/Makefile.in

    r3869 r3966  
    6868        text_engine.$(OBJEXT) array.$(OBJEXT) objModel.$(OBJEXT) \
    6969        primitive_model.$(OBJEXT) model.$(OBJEXT) material.$(OBJEXT) \
    70         texture.$(OBJEXT) base_entity.$(OBJEXT) base_object.$(OBJEXT) \
     70        texture.$(OBJEXT) particle_engine.$(OBJEXT) \
     71        particle_system.$(OBJEXT) particle_emitter.$(OBJEXT) \
     72        base_entity.$(OBJEXT) base_object.$(OBJEXT) \
    7173        ini_parser.$(OBJEXT) list.$(OBJEXT) resource_manager.$(OBJEXT) \
    7274        vector.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT)
     
    9698@AMDEP_TRUE@    ./$(DEPDIR)/null_parent.Po ./$(DEPDIR)/objModel.Po \
    9799@AMDEP_TRUE@    ./$(DEPDIR)/orxonox.Po ./$(DEPDIR)/p_node.Po \
     100@AMDEP_TRUE@    ./$(DEPDIR)/particle_emitter.Po \
     101@AMDEP_TRUE@    ./$(DEPDIR)/particle_engine.Po \
     102@AMDEP_TRUE@    ./$(DEPDIR)/particle_system.Po \
    98103@AMDEP_TRUE@    ./$(DEPDIR)/player.Po \
    99104@AMDEP_TRUE@    ./$(DEPDIR)/primitive_model.Po \
     
    237242target_vendor = @target_vendor@
    238243MAINSRCDIR = .
    239 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/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -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
     244AM_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/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -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
    240245AM_LDFLAGS = $(MWINDOWS)
    241246orxonox_SOURCES = orxonox.cc \
     
    279284                 lib/graphics/importer/material.cc \
    280285                 lib/graphics/importer/texture.cc \
     286                 lib/graphics/particles/particle_engine.cc \
     287                 lib/graphics/particles/particle_system.cc \
     288                 lib/graphics/particles/particle_emitter.cc \
    281289                 lib/lang/base_entity.cc \
    282290                 lib/lang/base_object.cc \
     
    335343                 lib/graphics/light.h \
    336344                 lib/graphics/text_engine.h \
     345                 lib/graphics/particles/particle_engine.h \
     346                 lib/graphics/particles/particle_system.h \
     347                 lib/graphics/particles/particle_emitter.h \
    337348                 lib/data/data_tank.h \
    338349                 lib/lang/base_entity.h \
     
    454465@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox.Po@am__quote@
    455466@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_node.Po@am__quote@
     467@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/particle_emitter.Po@am__quote@
     468@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/particle_engine.Po@am__quote@
     469@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/particle_system.Po@am__quote@
    456470@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/player.Po@am__quote@
    457471@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/primitive_model.Po@am__quote@
     
    10171031@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    10181032@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o texture.obj `if test -f 'lib/graphics/importer/texture.cc'; then $(CYGPATH_W) 'lib/graphics/importer/texture.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/importer/texture.cc'; fi`
     1033
     1034particle_engine.o: lib/graphics/particles/particle_engine.cc
     1035@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 'lib/graphics/particles/particle_engine.cc' || echo '$(srcdir)/'`lib/graphics/particles/particle_engine.cc; \
     1036@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/particle_engine.Tpo" "$(DEPDIR)/particle_engine.Po"; else rm -f "$(DEPDIR)/particle_engine.Tpo"; exit 1; fi
     1037@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/graphics/particles/particle_engine.cc' object='particle_engine.o' libtool=no @AMDEPBACKSLASH@
     1038@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/particle_engine.Po' tmpdepfile='$(DEPDIR)/particle_engine.TPo' @AMDEPBACKSLASH@
     1039@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1040@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_engine.o `test -f 'lib/graphics/particles/particle_engine.cc' || echo '$(srcdir)/'`lib/graphics/particles/particle_engine.cc
     1041
     1042particle_engine.obj: lib/graphics/particles/particle_engine.cc
     1043@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 'lib/graphics/particles/particle_engine.cc'; then $(CYGPATH_W) 'lib/graphics/particles/particle_engine.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/particles/particle_engine.cc'; fi`; \
     1044@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/particle_engine.Tpo" "$(DEPDIR)/particle_engine.Po"; else rm -f "$(DEPDIR)/particle_engine.Tpo"; exit 1; fi
     1045@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/graphics/particles/particle_engine.cc' object='particle_engine.obj' libtool=no @AMDEPBACKSLASH@
     1046@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/particle_engine.Po' tmpdepfile='$(DEPDIR)/particle_engine.TPo' @AMDEPBACKSLASH@
     1047@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1048@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_engine.obj `if test -f 'lib/graphics/particles/particle_engine.cc'; then $(CYGPATH_W) 'lib/graphics/particles/particle_engine.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/particles/particle_engine.cc'; fi`
     1049
     1050particle_system.o: lib/graphics/particles/particle_system.cc
     1051@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 'lib/graphics/particles/particle_system.cc' || echo '$(srcdir)/'`lib/graphics/particles/particle_system.cc; \
     1052@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/particle_system.Tpo" "$(DEPDIR)/particle_system.Po"; else rm -f "$(DEPDIR)/particle_system.Tpo"; exit 1; fi
     1053@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/graphics/particles/particle_system.cc' object='particle_system.o' libtool=no @AMDEPBACKSLASH@
     1054@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/particle_system.Po' tmpdepfile='$(DEPDIR)/particle_system.TPo' @AMDEPBACKSLASH@
     1055@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1056@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_system.o `test -f 'lib/graphics/particles/particle_system.cc' || echo '$(srcdir)/'`lib/graphics/particles/particle_system.cc
     1057
     1058particle_system.obj: lib/graphics/particles/particle_system.cc
     1059@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 'lib/graphics/particles/particle_system.cc'; then $(CYGPATH_W) 'lib/graphics/particles/particle_system.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/particles/particle_system.cc'; fi`; \
     1060@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/particle_system.Tpo" "$(DEPDIR)/particle_system.Po"; else rm -f "$(DEPDIR)/particle_system.Tpo"; exit 1; fi
     1061@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/graphics/particles/particle_system.cc' object='particle_system.obj' libtool=no @AMDEPBACKSLASH@
     1062@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/particle_system.Po' tmpdepfile='$(DEPDIR)/particle_system.TPo' @AMDEPBACKSLASH@
     1063@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1064@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_system.obj `if test -f 'lib/graphics/particles/particle_system.cc'; then $(CYGPATH_W) 'lib/graphics/particles/particle_system.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/particles/particle_system.cc'; fi`
     1065
     1066particle_emitter.o: lib/graphics/particles/particle_emitter.cc
     1067@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 'lib/graphics/particles/particle_emitter.cc' || echo '$(srcdir)/'`lib/graphics/particles/particle_emitter.cc; \
     1068@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/particle_emitter.Tpo" "$(DEPDIR)/particle_emitter.Po"; else rm -f "$(DEPDIR)/particle_emitter.Tpo"; exit 1; fi
     1069@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/graphics/particles/particle_emitter.cc' object='particle_emitter.o' libtool=no @AMDEPBACKSLASH@
     1070@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/particle_emitter.Po' tmpdepfile='$(DEPDIR)/particle_emitter.TPo' @AMDEPBACKSLASH@
     1071@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1072@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_emitter.o `test -f 'lib/graphics/particles/particle_emitter.cc' || echo '$(srcdir)/'`lib/graphics/particles/particle_emitter.cc
     1073
     1074particle_emitter.obj: lib/graphics/particles/particle_emitter.cc
     1075@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 'lib/graphics/particles/particle_emitter.cc'; then $(CYGPATH_W) 'lib/graphics/particles/particle_emitter.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/particles/particle_emitter.cc'; fi`; \
     1076@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/particle_emitter.Tpo" "$(DEPDIR)/particle_emitter.Po"; else rm -f "$(DEPDIR)/particle_emitter.Tpo"; exit 1; fi
     1077@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/graphics/particles/particle_emitter.cc' object='particle_emitter.obj' libtool=no @AMDEPBACKSLASH@
     1078@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/particle_emitter.Po' tmpdepfile='$(DEPDIR)/particle_emitter.TPo' @AMDEPBACKSLASH@
     1079@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1080@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_emitter.obj `if test -f 'lib/graphics/particles/particle_emitter.cc'; then $(CYGPATH_W) 'lib/graphics/particles/particle_emitter.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/particles/particle_emitter.cc'; fi`
    10191081
    10201082base_entity.o: lib/lang/base_entity.cc
     
    12681330
    12691331distdir: $(DISTFILES)
    1270         $(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics $(distdir)/lib/lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/network $(distdir)/proto $(distdir)/story_entities $(distdir)/util $(distdir)/util/animation $(distdir)/util/common $(distdir)/world_entities
     1332        $(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics $(distdir)/lib/graphics/particles $(distdir)/lib/lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/network $(distdir)/proto $(distdir)/story_entities $(distdir)/util $(distdir)/util/animation $(distdir)/util/common $(distdir)/world_entities
    12711333        @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
    12721334        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
  • orxonox/trunk/src/defs/debug.h

    r3875 r3966  
    6363#define DEBUG_MODULE_LOAD               0
    6464
    65 #define DEBUG_MODULE_IMPORTER           1
     65#define DEBUG_MODULE_IMPORTER           3
    6666#define DEBUG_MODULE_TRACK_MANAGER      0
    6767#define DEBUG_MODULE_GARBAGE_COLLECTOR  0
     
    7272#define DEBUG_MODULE_FONT               1
    7373#define DEBUG_MODULE_ANIM               1
     74#define DEBUG_MODULE_PARTICLE           4
    7475
    7576#define DEBUG_MODULE_NULL_PARENT        0
  • orxonox/trunk/src/lib/coord/null_parent.cc

    r3809 r3966  
    5454  this->parent = this;
    5555  this->mode = PNODE_ALL;
    56   *this->absCoordinate = absCoordinate;
     56  this->absCoordinate = absCoordinate;
    5757  this->setName("NullParent");
    5858}
     
    8080{
    8181
    82   PRINTF(4)("NullParent::update - (%f, %f, %f)\n", this->absCoordinate->x, this->absCoordinate->y, this->absCoordinate->z);
    83   *this->absCoordinate = *this->relCoordinate;
    84   *this->absDirection = parent->getAbsDir () * *this->relDirection;
     82  PRINTF(4)("NullParent::update - (%f, %f, %f)\n", this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);
     83  this->absCoordinate = this->relCoordinate;
     84  this->absDirection = parent->getAbsDir () * this->relDirection;
    8585
    8686  tIterator<PNode>* iterator = this->children->getIterator();
  • orxonox/trunk/src/lib/coord/p_node.cc

    r3860 r3966  
    6060  this->init(parent);
    6161
    62   *this->absCoordinate = absCoordinate;
     62  this->absCoordinate = absCoordinate;
    6363
    6464  if (likely(parent != NULL))
    6565  {
    66     *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor ();
     66    this->relCoordinate = this->absCoordinate - parent->getAbsCoor();
    6767    parent->addChild (this);
    6868  }
    69   else
    70     this->relCoordinate = new Vector();
    7169}
    7270
     
    8987  delete []this->objectName;
    9088
    91   delete this->relCoordinate;
    92   delete this->absCoordinate;
    93   delete this->relDirection;
    94   delete this->absDirection;
    95   delete this->lastAbsCoordinate;
    96   delete this->diffCoordinate;
    9789}
    9890
     
    108100  this->objectName = NULL;
    109101  this->time = 1.0; /* set time to 1 to make divisions by zero impossible */
    110 
    111   this->absCoordinate = new Vector();
    112   this->relCoordinate = new Vector();
    113   this->absDirection = new Quaternion();
    114   this->relDirection = new Quaternion();
    115   this->lastAbsCoordinate = new Vector();
    116   this->diffCoordinate = new Vector();
    117102}
    118103
     
    158143{
    159144  this->bRelCoorChanged = true;
    160   *this->relCoordinate = relCoord;
     145  this->relCoordinate = relCoord;
    161146}
    162147
     
    182167{
    183168  this->bAbsCoorChanged = true;
    184   *this->absCoordinate = absCoord;
     169  this->absCoordinate = absCoord;
    185170}
    186171
     
    211196  if( unlikely(this->bAbsCoorChanged))
    212197    {
    213       *this->absCoordinate = *this->absCoordinate + shift;
     198      this->absCoordinate += shift;
    214199    }
    215200  else
    216201    {
    217       *this->relCoordinate = *this->relCoordinate + shift;
     202      this->relCoordinate += shift;
    218203      this->bRelCoorChanged = true;
    219204    }
     
    241226{
    242227  this->bRelCoorChanged = true;
    243   *this->relDirection = relDir;
     228  this->relDirection = relDir;
    244229}
    245230
     
    264249{
    265250  this->bAbsDirChanged = true;
    266   *this->absDirection = absDir;
     251  this->absDirection = absDir;
    267252}
    268253
     
    293278{
    294279  this->bRelDirChanged = true;
    295   *this->relDirection = *this->relDirection * shift;
     280  this->relDirection = this->relDirection * shift;
    296281}
    297282
     
    303288float PNode::getSpeed() const
    304289{
    305   *this->diffCoordinate = *this->absCoordinate - *this->lastAbsCoordinate;
    306   return this->diffCoordinate->len() / this->time;
    307 }
    308 
     290  return (this->absCoordinate - this->lastAbsCoordinate).len() / this->time;
     291}
     292
     293/**
     294   \returns the Velocity of the PNode
     295*/
     296Vector PNode::getVelocity() const
     297{
     298  return (this->absCoordinate - this->lastAbsCoordinate) / this->time;
     299}
    309300
    310301/**
     
    432423void PNode::update (float dt)
    433424{
    434   *this->lastAbsCoordinate = *this->absCoordinate;
     425  this->lastAbsCoordinate = this->absCoordinate;
    435426  this->time = dt;
    436   PRINTF(4)("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate->x, this->absCoordinate->y, this->absCoordinate->z);
     427  PRINTF(4)("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);
    437428
    438429
     
    442433        {
    443434          /* if you have set the absolute coordinates this overrides all other changes */
    444           *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor ();
     435          this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
    445436        }
    446437      if( likely(this->bRelCoorChanged) /*&& this->timeStamp != DataTank::timeStamp*/)
     
    455446            }
    456447            else */
    457           *this->absCoordinate = parent->getAbsCoor() + *this->relCoordinate;         /* update the current absCoordinate */
     448          this->absCoordinate = parent->getAbsCoor() + this->relCoordinate;           /* update the current absCoordinate */
    458449        }
    459450    }
     
    464455        {
    465456          /* if you have set the absolute coordinates this overrides all other changes */
    466           *this->relDirection = *this->absDirection - parent->getAbsDir();
     457          this->relDirection = this->absDirection - parent->getAbsDir();
    467458        }
    468459      else if( likely(this->bRelDirChanged) /*&& this->timeStamp != DataTank::timeStamp*/)
    469460        {
    470461          /* update the current absDirection - remember * means rotation around sth.*/
    471           *this->absDirection = parent->getAbsDir() * *this->relDirection;
     462          this->absDirection = parent->getAbsDir() * this->relDirection;
    472463        }
    473464    }
     
    478469        {
    479470          /* if you have set the absolute coordinates this overrides all other changes */
    480           *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor ();
     471          this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
    481472        }
    482473      else if( likely(this->bRelCoorChanged) /*&& this->timeStamp != DataTank::timeStamp*/)
     
    486477            *this->absCoordinate = *this->relCoordinate;
    487478            else*/
    488           *this->absCoordinate = parent->getAbsCoor() + parent->getAbsDir().apply(*this->relCoordinate);              /* update the current absCoordinate */
     479          this->absCoordinate = parent->getAbsCoor() + parent->getAbsDir().apply(this->relCoordinate);        /* update the current absCoordinate */
    489480        }
    490481    }
     
    540531{
    541532  PRINTF(2)("PNode::debug() - absCoord: (%f, %f, %f)\n",
    542          this->absCoordinate->x,
    543          this->absCoordinate->y,
    544          this->absCoordinate->z);
     533         this->absCoordinate.x,
     534         this->absCoordinate.y,
     535         this->absCoordinate.z);
    545536}
    546537
     
    551542  for debug purposes realy usefull, not used to work properly
    552543*/
    553 void PNode::setName (char* newName)
     544void PNode::setName (const char* newName)
    554545{
    555546  this->objectName = new char[strlen(newName)+1];
     
    561552  \brief gets the name of the node
    562553*/
    563 char* PNode::getName ()
     554const char* PNode::getName ()
    564555{
    565556  return this->objectName;
  • orxonox/trunk/src/lib/coord/p_node.h

    r3813 r3966  
    5757
    5858
    59   inline Vector* getRelCoor () const { return this->relCoordinate; }
     59  inline const Vector& getRelCoor () const { return this->relCoordinate; }
    6060  void setRelCoor (const Vector& relCoord);
    61   inline Vector getAbsCoor () const { return *this->absCoordinate; }
     61  inline const Vector& getAbsCoor () const { return this->absCoordinate; }
    6262  void setAbsCoor (const Vector& absCoord);
    6363  void shiftCoor (const Vector& shift);
    6464
    65   inline Quaternion getRelDir () const { return *this->relDirection; }
     65  inline const Quaternion& getRelDir () const { return this->relDirection; }
    6666  void setRelDir (const Quaternion& relDir);
    67   inline Quaternion getAbsDir () const { return *this->absDirection; }
     67  inline const Quaternion& getAbsDir () const { return this->absDirection; }
    6868  void setAbsDir (const Quaternion& absDir);
    6969  void shiftDir (const Quaternion& shift);
    7070
    7171  float getSpeed() const;
     72  Vector getVelocity() const;
    7273
    7374  void addChild (PNode* pNode, int parentingMode = DEFAULT_MODE);
     
    8586  void processTick (float dt);
    8687
    87   void setName (char* newName);
    88   char* getName ();
     88  void setName (const char* newName);
     89  const char* getName ();
    8990
    9091
     
    99100  bool bRelDirChanged;     //!< If Relative Direction has changed since last time we checked
    100101
    101   Vector* relCoordinate;    //!< coordinates relative to the parent
    102   Vector* absCoordinate;    //!< absolute coordinates in the world ( from (0,0,0) )
    103   Quaternion* relDirection; //!< direction relative to the parent
    104   Quaternion* absDirection; //!< absolute direvtion in the world ( from (0,0,1) )
     102  Vector relCoordinate;    //!< coordinates relative to the parent
     103  Vector absCoordinate;    //!< absolute coordinates in the world ( from (0,0,0) )
     104  Quaternion relDirection; //!< direction relative to the parent
     105  Quaternion absDirection; //!< absolute direvtion in the world ( from (0,0,1) )
    105106
    106107  int mode;                //!< the mode of the binding
     
    109110  void init(PNode* parent);
    110111
    111   Vector* lastAbsCoordinate; //!< this is used for speedcalculation, it stores the last coordinate
    112   Vector* diffCoordinate;    //!< this is stored here for performance reasons, difference to the last vector
     112  Vector lastAbsCoordinate; //!< this is used for speedcalculation, it stores the last coordinate
     113  Vector diffCoordinate;    //!< this is stored here for performance reasons, difference to the last vector
    113114  float time;                //!< time since last update
    114115};
  • orxonox/trunk/src/lib/graphics/importer/material.cc

    r3914 r3966  
    8888 
    8989  // setting the transparency
    90   if (this->transparency == 1.0)
    91     {
    92       glDisable(GL_BLEND);
    93     }
    94   else
     90  if (this->transparency < 1.0)
    9591    {
    9692      glEnable(GL_BLEND);
     
    9894      glBlendFunc(GL_SRC_ALPHA, GL_ONE);
    9995    }
     96  else
     97    {
     98      glDisable(GL_BLEND);
     99      glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
     100    }
     101
    100102
    101103  // setting illumination Model
     
    109111      glEnable(GL_TEXTURE_2D);
    110112      glBindTexture(GL_TEXTURE_2D, this->diffuseTexture->getTexture());
     113
     114      /* This allows alpha blending of 2D textures with the scene */
     115      if (this->diffuseTexture->hasAlpha())
     116        {
     117          glEnable(GL_BLEND);
     118          glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     119        }
    111120    }
    112121  else
  • orxonox/trunk/src/lib/graphics/importer/texture.cc

    r3905 r3966  
    2525Texture::Texture(const char* imageName)
    2626{
     27  bAlpha = false;
    2728  this->texture = 0;
    2829  if (imageName)
     
    112113      if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
    113114        SDL_SetAlpha(surface, saved_flags | SDL_OPENGL, saved_alpha);
     115        this->bAlpha = true;
    114116      }
    115117     
     
    119121      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
    120122      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    121       /*      glTexImage2D(GL_TEXTURE_2D,
     123      // build the Texture
     124      glTexImage2D(GL_TEXTURE_2D,
    122125                   0,
    123126                   GL_RGBA,
     
    127130                   GL_UNSIGNED_BYTE,
    128131                   image->pixels);
    129       */
     132      // build the MipMaps
    130133      gluBuild2DMipmaps(GL_TEXTURE_2D,
    131                         3,
     134                        GL_RGBA,
    132135                        w,
    133136                        h,
     
    135138                        GL_UNSIGNED_BYTE,
    136139                        image->pixels);
    137 
     140     
    138141      SDL_FreeSurface(image); /* No longer needed */
    139142     
  • orxonox/trunk/src/lib/graphics/importer/texture.h

    r3905 r3966  
    2323  char* searchTextureInPaths(const char* texName) const;
    2424  void swap(unsigned char &a, unsigned char &b);
     25
     26  bool bAlpha;           //!< if the texture has an alpha channel.
    2527 public:
    2628  Texture(const char* imageName = NULL);
     
    3032  inline GLuint getTexture(void) {return this->texture;}
    3133  GLuint loadTexToGL (SDL_Surface* surface);
     34  inline bool hasAlpha(void) {return bAlpha;}
    3235
    3336  bool loadImage(const char* imageName);
  • orxonox/trunk/src/lib/math/vector.cc

    r3860 r3966  
    100100*/
    101101
    102 Vector* Vector::getNormalized()
     102Vector Vector::getNormalized()
    103103{
    104104  float l = len();
    105105  if(unlikely(l != 1.0))
    106106    {
    107       return this;
     107      return *this;
    108108    }
    109109  else if(unlikely(l == 0.0))
    110110    {
    111       return 0;
     111      return *this;
    112112    }
    113113
    114   return new Vector(x / l, y /l, z / l);
     114  return *this / l;
    115115}
    116116
     
    172172   \brief Outputs the values of the Vector
    173173*/
    174 void Vector::debug(void)
     174void Vector::debug(void) const
    175175{
    176176  PRINT(0)("Vector Debug information\n");
     
    438438   \param to to where
    439439   \param t the time this transformation should take
    440    \param res The approximation-density
    441 */
    442 void Quaternion::quatSlerp(const Quaternion* from, const Quaternion* to, float t, Quaternion* res)
     440
     441   \returns the Result of the smooth move
     442*/
     443Quaternion Quaternion::quatSlerp(const Quaternion& from, const Quaternion& to, float t)
    443444{
    444445  float tol[4];
     
    446447  DELTA = 0.2;
    447448
    448   cosom = from->v.x * to->v.x + from->v.y * to->v.y + from->v.z * to->v.z + from->w * to->w;
     449  cosom = from.v.x * to.v.x + from.v.y * to.v.y + from.v.z * to.v.z + from.w * to.w;
    449450
    450451  if( cosom < 0.0 )
    451452    {
    452453      cosom = -cosom;
    453       tol[0] = -to->v.x;
    454       tol[1] = -to->v.y;
    455       tol[2] = -to->v.z;
    456       tol[3] = -to->w;
     454      tol[0] = -to.v.x;
     455      tol[1] = -to.v.y;
     456      tol[2] = -to.v.z;
     457      tol[3] = -to.w;
    457458    }
    458459  else
    459460    {
    460       tol[0] = to->v.x;
    461       tol[1] = to->v.y;
    462       tol[2] = to->v.z;
    463       tol[3] = to->w;
     461      tol[0] = to.v.x;
     462      tol[1] = to.v.y;
     463      tol[2] = to.v.z;
     464      tol[3] = to.w;
    464465    }
    465466 
    466467  //if( (1.0 - cosom) > DELTA )
    467468  //{
    468       omega = acos(cosom);
    469       sinom = sin(omega);
    470       scale0 = sin((1.0 - t) * omega) / sinom;
    471       scale1 = sin(t * omega) / sinom;
    472       //}
    473       /*
    474   else
     469  omega = acos(cosom);
     470  sinom = sin(omega);
     471  scale0 = sin((1.0 - t) * omega) / sinom;
     472  scale1 = sin(t * omega) / sinom;
     473  //}
     474  /*
     475    else
    475476    {
    476       scale0 = 1.0 - t;
    477       scale1 = t;
     477    scale0 = 1.0 - t;
     478    scale1 = t;
    478479    }
    479       */
    480   res->v.x = scale0 * from->v.x + scale1 * tol[0];
    481   res->v.y = scale0 * from->v.y + scale1 * tol[1];
    482   res->v.z = scale0 * from->v.z + scale1 * tol[2];
    483   res->w = scale0 * from->w + scale1 * tol[3];
     480  */
     481
     482
     483  /*
     484    Quaternion res;
     485    res.v.x = scale0 * from.v.x + scale1 * tol[0];
     486    res.v.y = scale0 * from.v.y + scale1 * tol[1];
     487    res.v.z = scale0 * from.v.z + scale1 * tol[2];
     488    res.w = scale0 * from.w + scale1 * tol[3];
     489  */
     490  return Quaternion(scale0 * from.w + scale1 * tol[3],
     491                    Vector(scale0 * from.v.x + scale1 * tol[0],
     492                           scale0 * from.v.y + scale1 * tol[1],
     493                           scale0 * from.v.z + scale1 * tol[2]));
    484494}
    485495
  • orxonox/trunk/src/lib/math/vector.h

    r3860 r3966  
    3131
    3232  inline Vector operator+ (const Vector& v) const { return Vector(x + v.x, y + v.y, z + v.z); }
     33  inline const Vector& operator+= (const Vector& v) {this->x += v.x; this->y += v.y; this->z += v.z; return *this;}
    3334  inline Vector operator- (const Vector& v) const { return Vector(x - v.x, y - v.y, z - v.z); }
     35  inline const Vector& operator-= (const Vector& v) {this->x -= v.x; this->y -= v.y; this->z -= v.z; return *this;}
    3436  inline float operator* (const Vector& v) const { return x * v.x + y * v.y + z * v.z; }
     37  inline const Vector& operator*= (const Vector& v) {this->x *= v.x; this->y *= v.y; this->z *= v.z; return *this;}
    3538  inline Vector operator* (float f) const { return Vector(x * f, y * f, z * f); }
     39  inline const Vector& operator*= (float f) {this->x *= f; this->y *= f; this->z *= f; return *this;}
    3640  Vector operator/ (float f) const;
     41  inline const Vector& operator/= (float f) {this->x /= f; this->y /= f; this->z /= f; return *this;}
     42  inline const Vector& operator= (const Vector& v) {this->x = v.x; this->y = v.y; this->z = v.z; return *this;}
    3743  float dot (const Vector& v) const;
    38   inline Vector cross (const Vector& v) const {  return Vector(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x ); }
     44  inline Vector cross (const Vector& v) const { return Vector(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x ); }
    3945  void scale(const Vector& v);
    4046  inline float len() const { return sqrt (x*x+y*y+z*z); }
     
    5056                      z = z / l;
    5157                    }
    52   Vector* getNormalized();
     58  Vector getNormalized();
    5359  Vector abs();
    5460
    55   void debug();
     61  void debug() const;
    5662};
    5763
     
    7682  Quaternion (float roll, float pitch, float yaw);
    7783  Quaternion operator/ (const float& f) const;
     84  inline const Quaternion operator/= (const float& f) {*this = *this / f; return *this;}
    7885  Quaternion operator* (const float& f) const;
     86  inline const Quaternion operator*= (const float& f) {*this = *this * f; return *this;}
    7987  Quaternion operator* (const Quaternion& q) const;
     88  inline const Quaternion operator*= (const Quaternion& q) {*this = *this * q; return *this;}
    8089  inline Quaternion operator+ (const Quaternion& q) const { return Quaternion(q.v + v, q.w + w); }
     90  inline const Quaternion& operator+= (const Quaternion& q) {this->v += q.v; this->w += q.w; return *this;}
    8191  inline Quaternion operator- (const Quaternion& q) const { return Quaternion(q.v - v, q.w - w); }
     92  inline const Quaternion& operator-= (const Quaternion& q) {this->v -= q.v; this->w -= q.w; return *this;}
     93  inline Quaternion operator= (const Quaternion& q) {this->v = q.v; this->w = q.w; return *this;}
    8294  Quaternion conjugate () const {  Quaternion r(*this);
    8395  r.v = Vector() - r.v;
     
    8799  float norm () const;
    88100  void matrix (float m[4][4]) const;
    89   void quatSlerp(const Quaternion* from, const Quaternion* to, const float t, Quaternion* res);
     101  Quaternion quatSlerp(const Quaternion& from, const Quaternion& to, float t);
    90102 
    91103  void debug();
  • orxonox/trunk/src/orxonox.cc

    r3790 r3966  
    3636
    3737#include <string.h>
    38 int verbose = 3;
     38int verbose = 4;
    3939
    4040using namespace std;
  • orxonox/trunk/src/track_manager.cc

    r3882 r3966  
    312312  PNode* tmpNode = (PNode*)node;
    313313
    314   if (tmpNode->getRelCoor()->z < 0)
     314  if (tmpNode->getRelCoor().z < 0)
    315315    return 0;
    316316  else
     
    333333  PNode* tmpNode = (PNode*)node;
    334334
    335   Vector nodeRelCoord = *tmpNode->getRelCoor();
     335  Vector nodeRelCoord = tmpNode->getRelCoor();
    336336  float minDist = 100000000;
    337337  int childNumber = 0;
  • orxonox/trunk/src/track_node.cc

    r3607 r3966  
    4141
    4242
    43 TrackNode::TrackNode (Vector* absCoordinate)
     43TrackNode::TrackNode (const Vector& absCoordinate)
    4444{
    4545  this->parent = NullParent::getInstance();
    4646  this->trackManager = TrackManager::getInstance();
    4747  this->setMode(PNODE_ALL);
    48   this->absCoordinate = absCoordinate;
     48  this->setAbsCoor(absCoordinate);
    4949}
    5050
  • orxonox/trunk/src/track_node.h

    r3836 r3966  
    2222 public:
    2323  TrackNode ();
    24   TrackNode (Vector* absCoordinate);
     24  TrackNode (const Vector& absCoordinate);
    2525
    2626  virtual ~TrackNode ();
  • orxonox/trunk/src/world_entities/camera.cc

    r3869 r3966  
    139139  if (tmpFovy > .001)
    140140    this->fovy += (this->toFovy - this->fovy) * dt;
    141   Vector tmpPos = (this->toRelCoor - *this->getRelCoor()) * dt;
     141  Vector tmpPos = (this->toRelCoor - this->getRelCoor()) * dt;
    142142  if (tmpPos.len() >= .001)
    143143    {
    144       tmpPos = tmpPos + *this->getRelCoor();
     144      tmpPos = tmpPos + this->getRelCoor();
    145145      this->setRelCoor(tmpPos);
    146146    }
  • orxonox/trunk/src/world_entities/player.cc

    r3881 r3966  
    188188  //orthDirection = orthDirection.cross (direction);
    189189
    190   if( this->bUp && this->getRelCoor()->x < 20)
     190  if( this->bUp && this->getRelCoor().x < 20)
    191191    accel = accel+(direction*acceleration);
    192   if( this->bDown && this->getRelCoor()->x > -5)
     192  if( this->bDown && this->getRelCoor().x > -5)
    193193    accel = accel-(direction*acceleration);
    194   if( this->bLeft &&  TrackManager::getInstance()->getWidth() > -this->getRelCoor()->z*2)
     194  if( this->bLeft &&  TrackManager::getInstance()->getWidth() > -this->getRelCoor().z*2)
    195195    accel = accel - (orthDirection*acceleration);
    196   if( this->bRight &&  TrackManager::getInstance()->getWidth() > this->getRelCoor()->z*2)
     196  if( this->bRight &&  TrackManager::getInstance()->getWidth() > this->getRelCoor().z*2)
    197197    accel = accel + (orthDirection*acceleration);
    198198  if( this->bAscend )
Note: See TracChangeset for help on using the changeset viewer.