Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4180 in orxonox.OLD for orxonox/branches/physics


Ignore:
Timestamp:
May 13, 2005, 11:57:13 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/physics: added a simple force; GRAVITY

Location:
orxonox/branches/physics/src
Files:
1 added
2 edited
2 copied
2 moved

Legend:

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

    r4179 r4180  
    2323AM_CXXFLAGS+=-I$(MAINSRCDIR)/util/common
    2424AM_CXXFLAGS+=-I$(MAINSRCDIR)/util/physics
     25AM_CXXFLAGS+=-I$(MAINSRCDIR)/util/physics/fields
    2526AM_CXXFLAGS+=-I$(MAINSRCDIR)/subprojects
    2627
     
    8990                 util/physics/physical_interaction_sym.cc \
    9091                 util/physics/physical_interaction_asym.cc \
    91                  util/physics/field.cc \
     92                 util/physics/fields/field.cc \
     93                 util/physics/fields/gravity.cc \
    9294                 lib/math/vector.cc \
    9395                 lib/math/curve.cc \
     
    161163                 util/physics/physical_interaction_sym.h \
    162164                 util/physics/physical_interaction_asym.h \
    163                  util/physics/field.h \
     165                 util/physics/fields/field.h \
     166                 util/physics/fields/gravity.h \
    164167                 lib/util/ini_parser.h \
    165168                 lib/math/vector.h \
  • orxonox/branches/physics/src/Makefile.in

    r4179 r4180  
    9292        physical_interaction_sym.$(OBJEXT) \
    9393        physical_interaction_asym.$(OBJEXT) field.$(OBJEXT) \
    94         vector.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT) \
    95         tinyxml.$(OBJEXT) tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT) \
     94        gravity.$(OBJEXT) vector.$(OBJEXT) curve.$(OBJEXT) \
     95        glmenu_imagescreen.$(OBJEXT) tinyxml.$(OBJEXT) \
     96        tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT) \
    9697        tinyxmlparser.$(OBJEXT) benchmark.$(OBJEXT)
    9798orxonox_OBJECTS = $(am_orxonox_OBJECTS)
     
    115116@AMDEP_TRUE@    ./$(DEPDIR)/glmenu_imagescreen.Po \
    116117@AMDEP_TRUE@    ./$(DEPDIR)/graphics_engine.Po \
     118@AMDEP_TRUE@    ./$(DEPDIR)/gravity.Po \
    117119@AMDEP_TRUE@    ./$(DEPDIR)/helper_parent.Po \
    118120@AMDEP_TRUE@    ./$(DEPDIR)/i_physics.Po ./$(DEPDIR)/ini_parser.Po \
     
    282284target_vendor = @target_vendor@
    283285MAINSRCDIR = .
    284 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)/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/physics -I$(MAINSRCDIR)/subprojects
     286AM_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)/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/physics -I$(MAINSRCDIR)/util/physics/fields -I$(MAINSRCDIR)/subprojects
    285287noinst_LIBRARIES = libORXgui.a
    286288orxonox_DEPENDENCIES = libORXgui.a
     
    340342                 util/physics/physical_interaction_sym.cc \
    341343                 util/physics/physical_interaction_asym.cc \
    342                  util/physics/field.cc \
     344                 util/physics/fields/field.cc \
     345                 util/physics/fields/gravity.cc \
    343346                 lib/math/vector.cc \
    344347                 lib/math/curve.cc \
     
    412415                 util/physics/physical_interaction_sym.h \
    413416                 util/physics/physical_interaction_asym.h \
    414                  util/physics/field.h \
     417                 util/physics/fields/field.h \
     418                 util/physics/fields/gravity.h \
    415419                 lib/util/ini_parser.h \
    416420                 lib/math/vector.h \
     
    548552@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glmenu_imagescreen.Po@am__quote@
    549553@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graphics_engine.Po@am__quote@
     554@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gravity.Po@am__quote@
    550555@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/helper_parent.Po@am__quote@
    551556@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i_physics.Po@am__quote@
     
    15131518@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o physical_interaction_asym.obj `if test -f 'util/physics/physical_interaction_asym.cc'; then $(CYGPATH_W) 'util/physics/physical_interaction_asym.cc'; else $(CYGPATH_W) '$(srcdir)/util/physics/physical_interaction_asym.cc'; fi`
    15141519
    1515 field.o: util/physics/field.cc
    1516 @am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT field.o -MD -MP -MF "$(DEPDIR)/field.Tpo" -c -o field.o `test -f 'util/physics/field.cc' || echo '$(srcdir)/'`util/physics/field.cc; \
     1520field.o: util/physics/fields/field.cc
     1521@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT field.o -MD -MP -MF "$(DEPDIR)/field.Tpo" -c -o field.o `test -f 'util/physics/fields/field.cc' || echo '$(srcdir)/'`util/physics/fields/field.cc; \
    15171522@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/field.Tpo" "$(DEPDIR)/field.Po"; else rm -f "$(DEPDIR)/field.Tpo"; exit 1; fi
    1518 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/physics/field.cc' object='field.o' libtool=no @AMDEPBACKSLASH@
     1523@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/physics/fields/field.cc' object='field.o' libtool=no @AMDEPBACKSLASH@
    15191524@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/field.Po' tmpdepfile='$(DEPDIR)/field.TPo' @AMDEPBACKSLASH@
    15201525@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    1521 @am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o field.o `test -f 'util/physics/field.cc' || echo '$(srcdir)/'`util/physics/field.cc
    1522 
    1523 field.obj: util/physics/field.cc
    1524 @am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT field.obj -MD -MP -MF "$(DEPDIR)/field.Tpo" -c -o field.obj `if test -f 'util/physics/field.cc'; then $(CYGPATH_W) 'util/physics/field.cc'; else $(CYGPATH_W) '$(srcdir)/util/physics/field.cc'; fi`; \
     1526@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o field.o `test -f 'util/physics/fields/field.cc' || echo '$(srcdir)/'`util/physics/fields/field.cc
     1527
     1528field.obj: util/physics/fields/field.cc
     1529@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT field.obj -MD -MP -MF "$(DEPDIR)/field.Tpo" -c -o field.obj `if test -f 'util/physics/fields/field.cc'; then $(CYGPATH_W) 'util/physics/fields/field.cc'; else $(CYGPATH_W) '$(srcdir)/util/physics/fields/field.cc'; fi`; \
    15251530@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/field.Tpo" "$(DEPDIR)/field.Po"; else rm -f "$(DEPDIR)/field.Tpo"; exit 1; fi
    1526 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/physics/field.cc' object='field.obj' libtool=no @AMDEPBACKSLASH@
     1531@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/physics/fields/field.cc' object='field.obj' libtool=no @AMDEPBACKSLASH@
    15271532@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/field.Po' tmpdepfile='$(DEPDIR)/field.TPo' @AMDEPBACKSLASH@
    15281533@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    1529 @am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o field.obj `if test -f 'util/physics/field.cc'; then $(CYGPATH_W) 'util/physics/field.cc'; else $(CYGPATH_W) '$(srcdir)/util/physics/field.cc'; fi`
     1534@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o field.obj `if test -f 'util/physics/fields/field.cc'; then $(CYGPATH_W) 'util/physics/fields/field.cc'; else $(CYGPATH_W) '$(srcdir)/util/physics/fields/field.cc'; fi`
     1535
     1536gravity.o: util/physics/fields/gravity.cc
     1537@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gravity.o -MD -MP -MF "$(DEPDIR)/gravity.Tpo" -c -o gravity.o `test -f 'util/physics/fields/gravity.cc' || echo '$(srcdir)/'`util/physics/fields/gravity.cc; \
     1538@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/gravity.Tpo" "$(DEPDIR)/gravity.Po"; else rm -f "$(DEPDIR)/gravity.Tpo"; exit 1; fi
     1539@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/physics/fields/gravity.cc' object='gravity.o' libtool=no @AMDEPBACKSLASH@
     1540@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/gravity.Po' tmpdepfile='$(DEPDIR)/gravity.TPo' @AMDEPBACKSLASH@
     1541@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1542@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gravity.o `test -f 'util/physics/fields/gravity.cc' || echo '$(srcdir)/'`util/physics/fields/gravity.cc
     1543
     1544gravity.obj: util/physics/fields/gravity.cc
     1545@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gravity.obj -MD -MP -MF "$(DEPDIR)/gravity.Tpo" -c -o gravity.obj `if test -f 'util/physics/fields/gravity.cc'; then $(CYGPATH_W) 'util/physics/fields/gravity.cc'; else $(CYGPATH_W) '$(srcdir)/util/physics/fields/gravity.cc'; fi`; \
     1546@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/gravity.Tpo" "$(DEPDIR)/gravity.Po"; else rm -f "$(DEPDIR)/gravity.Tpo"; exit 1; fi
     1547@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/physics/fields/gravity.cc' object='gravity.obj' libtool=no @AMDEPBACKSLASH@
     1548@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/gravity.Po' tmpdepfile='$(DEPDIR)/gravity.TPo' @AMDEPBACKSLASH@
     1549@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1550@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gravity.obj `if test -f 'util/physics/fields/gravity.cc'; then $(CYGPATH_W) 'util/physics/fields/gravity.cc'; else $(CYGPATH_W) '$(srcdir)/util/physics/fields/gravity.cc'; fi`
    15301551
    15311552vector.o: lib/math/vector.cc
     
    17791800
    17801801distdir: $(DISTFILES)
    1781         $(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics $(distdir)/lib/graphics/particles $(distdir)/lib/gui/gui $(distdir)/lib/lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/network $(distdir)/proto $(distdir)/story_entities $(distdir)/subprojects $(distdir)/util $(distdir)/util/animation $(distdir)/util/common $(distdir)/util/physics $(distdir)/world_entities
     1802        $(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics $(distdir)/lib/graphics/particles $(distdir)/lib/gui/gui $(distdir)/lib/lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/network $(distdir)/proto $(distdir)/story_entities $(distdir)/subprojects $(distdir)/util $(distdir)/util/animation $(distdir)/util/common $(distdir)/util/physics $(distdir)/util/physics/fields $(distdir)/world_entities
    17821803        @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
    17831804        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
  • orxonox/branches/physics/src/util/physics/fields/field.h

    r4179 r4180  
    4242      \returns The Force Vector
    4343  */
    44   virtual Vector& calcForce(Vector& data) = 0;
     44  virtual Vector calcForce(const Vector& data) const = 0;
    4545
    4646  void setMagnitude(const float& magnitude);
    4747  /** \returns The Magnitude of the Field */
    48   const float& getMagnitude(void) const {return this->magnitude;}
     48  inline const float& getMagnitude(void) const {return this->magnitude;}
    4949
    5050  void setAttenuation(const float& attenuation);
    5151  /** \returns The Attenuation of the Fiels */
    52   const float& getAttenuation(void) const {return this->attenuation;}
     52  inline const float& getAttenuation(void) const {return this->attenuation;}
    5353
    5454 private:
  • orxonox/branches/physics/src/util/physics/fields/gravity.cc

    r4178 r4180  
    1616//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
    1717
    18 #include "proto_class.h"
     18#include "gravity.h"
    1919
    2020using namespace std;
     
    2525   \todo this constructor is not jet implemented - do it
    2626*/
    27 ProtoClass::ProtoClass ()
     27Gravity::Gravity ()
    2828{
    29    this->setClassName ("ProtoClass");
     29   this->setClassName ("Gravity");
    3030}
    3131
     
    3535
    3636*/
    37 ProtoClass::~ProtoClass ()
     37Gravity::~Gravity ()
    3838{
    3939  // delete what has to be deleted here
    4040}
     41
     42/**
     43   \brief calculates the Gravity on any point in space
     44   \param data The Position of the Point in space to attache gravity to.
     45   \returns The force.
     46*/
     47Vector Gravity::calcForce(const Vector& data) const
     48{
     49  return /*(this->getAbsDir().apply(Vector(0,1,0)))*/ Vector(0,-1,0) * this->getMagnitude();
     50}
     51
     52
  • orxonox/branches/physics/src/util/physics/fields/gravity.h

    r4178 r4180  
    11/*!
    2     \file proto_class.h
     2    \file gravity.h
    33    \brief Definition of ...
    44
    55*/
    66
    7 #ifndef _PROTO_CLASS_H
    8 #define _PROTO_CLASS_H
     7#ifndef _GRAVITY_H
     8#define _GRAVITY_H
    99
    10 #include "base_object.h"
     10#include "field.h"
    1111
    1212// FORWARD DEFINITION
     
    1515
    1616//! A class for ...
    17 class ProtoClass : public BaseObject {
     17class Gravity : public Field {
    1818
    1919 public:
    20   ProtoClass();
    21   virtual ~ProtoClass();
     20  Gravity();
     21  virtual ~Gravity();
    2222
     23  virtual Vector calcForce(const Vector& data) const;
    2324
    2425 private:
     
    2627};
    2728
    28 #endif /* _PROTO_CLASS_H */
     29#endif /* _GRAVITY_H */
Note: See TracChangeset for help on using the changeset viewer.