Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4184 in orxonox.OLD for orxonox/branches/physics/src


Ignore:
Timestamp:
May 14, 2005, 10:27:47 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/physics: new forces added

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

Legend:

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

    r4181 r4184  
    9393                 util/physics/fields/field.cc \
    9494                 util/physics/fields/gravity.cc \
     95                 util/physics/fields/point_gravity.cc \
     96                 util/physics/fields/twirl.cc \
    9597                 lib/math/vector.cc \
    9698                 lib/math/curve.cc \
     
    165167                 util/physics/physical_interaction_asym.h \
    166168                 util/physics/physics_connection.h \
     169                 util/physics/fields/fields.h \
    167170                 util/physics/fields/field.h \
    168171                 util/physics/fields/gravity.h \
     172                 util/physics/fields/point_gravity.h \
     173                 util/physics/fields/twirl.h \
    169174                 lib/util/ini_parser.h \
    170175                 lib/math/vector.h \
  • orxonox/branches/physics/src/Makefile.in

    r4181 r4184  
    9393        physical_interaction_asym.$(OBJEXT) \
    9494        physics_connection.$(OBJEXT) field.$(OBJEXT) gravity.$(OBJEXT) \
    95         vector.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT) \
    96         tinyxml.$(OBJEXT) tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT) \
     95        point_gravity.$(OBJEXT) twirl.$(OBJEXT) vector.$(OBJEXT) \
     96        curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT) tinyxml.$(OBJEXT) \
     97        tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT) \
    9798        tinyxmlparser.$(OBJEXT) benchmark.$(OBJEXT)
    9899orxonox_OBJECTS = $(am_orxonox_OBJECTS)
     
    142143@AMDEP_TRUE@    ./$(DEPDIR)/physics_connection.Po \
    143144@AMDEP_TRUE@    ./$(DEPDIR)/physics_engine.Po \
    144 @AMDEP_TRUE@    ./$(DEPDIR)/player.Po \
     145@AMDEP_TRUE@    ./$(DEPDIR)/player.Po ./$(DEPDIR)/point_gravity.Po \
    145146@AMDEP_TRUE@    ./$(DEPDIR)/primitive_model.Po \
    146147@AMDEP_TRUE@    ./$(DEPDIR)/projectile.Po \
     
    155156@AMDEP_TRUE@    ./$(DEPDIR)/tinyxmlparser.Po \
    156157@AMDEP_TRUE@    ./$(DEPDIR)/track_manager.Po \
    157 @AMDEP_TRUE@    ./$(DEPDIR)/track_node.Po ./$(DEPDIR)/vector.Po \
    158 @AMDEP_TRUE@    ./$(DEPDIR)/weapon.Po ./$(DEPDIR)/world.Po \
    159 @AMDEP_TRUE@    ./$(DEPDIR)/world_entity.Po
     158@AMDEP_TRUE@    ./$(DEPDIR)/track_node.Po ./$(DEPDIR)/twirl.Po \
     159@AMDEP_TRUE@    ./$(DEPDIR)/vector.Po ./$(DEPDIR)/weapon.Po \
     160@AMDEP_TRUE@    ./$(DEPDIR)/world.Po ./$(DEPDIR)/world_entity.Po
    160161CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
    161162        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     
    346347                 util/physics/fields/field.cc \
    347348                 util/physics/fields/gravity.cc \
     349                 util/physics/fields/point_gravity.cc \
     350                 util/physics/fields/twirl.cc \
    348351                 lib/math/vector.cc \
    349352                 lib/math/curve.cc \
     
    418421                 util/physics/physical_interaction_asym.h \
    419422                 util/physics/physics_connection.h \
     423                 util/physics/fields/fields.h \
    420424                 util/physics/fields/field.h \
    421425                 util/physics/fields/gravity.h \
     426                 util/physics/fields/point_gravity.h \
     427                 util/physics/fields/twirl.h \
    422428                 lib/util/ini_parser.h \
    423429                 lib/math/vector.h \
     
    587593@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/physics_engine.Po@am__quote@
    588594@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/player.Po@am__quote@
     595@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/point_gravity.Po@am__quote@
    589596@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/primitive_model.Po@am__quote@
    590597@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/projectile.Po@am__quote@
     
    605612@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track_manager.Po@am__quote@
    606613@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track_node.Po@am__quote@
     614@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twirl.Po@am__quote@
    607615@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@
    608616@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/weapon.Po@am__quote@
     
    15691577@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    15701578@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`
     1579
     1580point_gravity.o: util/physics/fields/point_gravity.cc
     1581@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT point_gravity.o -MD -MP -MF "$(DEPDIR)/point_gravity.Tpo" -c -o point_gravity.o `test -f 'util/physics/fields/point_gravity.cc' || echo '$(srcdir)/'`util/physics/fields/point_gravity.cc; \
     1582@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/point_gravity.Tpo" "$(DEPDIR)/point_gravity.Po"; else rm -f "$(DEPDIR)/point_gravity.Tpo"; exit 1; fi
     1583@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/physics/fields/point_gravity.cc' object='point_gravity.o' libtool=no @AMDEPBACKSLASH@
     1584@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/point_gravity.Po' tmpdepfile='$(DEPDIR)/point_gravity.TPo' @AMDEPBACKSLASH@
     1585@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1586@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o point_gravity.o `test -f 'util/physics/fields/point_gravity.cc' || echo '$(srcdir)/'`util/physics/fields/point_gravity.cc
     1587
     1588point_gravity.obj: util/physics/fields/point_gravity.cc
     1589@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT point_gravity.obj -MD -MP -MF "$(DEPDIR)/point_gravity.Tpo" -c -o point_gravity.obj `if test -f 'util/physics/fields/point_gravity.cc'; then $(CYGPATH_W) 'util/physics/fields/point_gravity.cc'; else $(CYGPATH_W) '$(srcdir)/util/physics/fields/point_gravity.cc'; fi`; \
     1590@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/point_gravity.Tpo" "$(DEPDIR)/point_gravity.Po"; else rm -f "$(DEPDIR)/point_gravity.Tpo"; exit 1; fi
     1591@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/physics/fields/point_gravity.cc' object='point_gravity.obj' libtool=no @AMDEPBACKSLASH@
     1592@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/point_gravity.Po' tmpdepfile='$(DEPDIR)/point_gravity.TPo' @AMDEPBACKSLASH@
     1593@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1594@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o point_gravity.obj `if test -f 'util/physics/fields/point_gravity.cc'; then $(CYGPATH_W) 'util/physics/fields/point_gravity.cc'; else $(CYGPATH_W) '$(srcdir)/util/physics/fields/point_gravity.cc'; fi`
     1595
     1596twirl.o: util/physics/fields/twirl.cc
     1597@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT twirl.o -MD -MP -MF "$(DEPDIR)/twirl.Tpo" -c -o twirl.o `test -f 'util/physics/fields/twirl.cc' || echo '$(srcdir)/'`util/physics/fields/twirl.cc; \
     1598@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/twirl.Tpo" "$(DEPDIR)/twirl.Po"; else rm -f "$(DEPDIR)/twirl.Tpo"; exit 1; fi
     1599@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/physics/fields/twirl.cc' object='twirl.o' libtool=no @AMDEPBACKSLASH@
     1600@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/twirl.Po' tmpdepfile='$(DEPDIR)/twirl.TPo' @AMDEPBACKSLASH@
     1601@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1602@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o twirl.o `test -f 'util/physics/fields/twirl.cc' || echo '$(srcdir)/'`util/physics/fields/twirl.cc
     1603
     1604twirl.obj: util/physics/fields/twirl.cc
     1605@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT twirl.obj -MD -MP -MF "$(DEPDIR)/twirl.Tpo" -c -o twirl.obj `if test -f 'util/physics/fields/twirl.cc'; then $(CYGPATH_W) 'util/physics/fields/twirl.cc'; else $(CYGPATH_W) '$(srcdir)/util/physics/fields/twirl.cc'; fi`; \
     1606@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/twirl.Tpo" "$(DEPDIR)/twirl.Po"; else rm -f "$(DEPDIR)/twirl.Tpo"; exit 1; fi
     1607@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/physics/fields/twirl.cc' object='twirl.obj' libtool=no @AMDEPBACKSLASH@
     1608@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/twirl.Po' tmpdepfile='$(DEPDIR)/twirl.TPo' @AMDEPBACKSLASH@
     1609@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1610@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o twirl.obj `if test -f 'util/physics/fields/twirl.cc'; then $(CYGPATH_W) 'util/physics/fields/twirl.cc'; else $(CYGPATH_W) '$(srcdir)/util/physics/fields/twirl.cc'; fi`
    15711611
    15721612vector.o: lib/math/vector.cc
  • orxonox/branches/physics/src/story_entities/world.cc

    r4183 r4184  
    492492
    493493
    494   ParticleSystem* system = new ParticleSystem(1000, PARTICLE_SPRITE);
    495   system->setLifeSpan(.5);
    496   system->setConserve(.99);
     494  ParticleSystem* system = new ParticleSystem(100000, PARTICLE_SPARK);
     495  system->setLifeSpan(5);
     496  system->setConserve(.9);
    497497  system->setRadius(2, 0, 2, 0);
    498498
    499   ParticleEmitter* emitter = new ParticleEmitter(Vector(-1, 0, 0), M_PI_4, 100, .05);
     499  ParticleEmitter* emitter = new ParticleEmitter(Vector(-1, 0, 0), M_PI_2, 5000, 1);
    500500  emitter->setParent(this->localPlayer);
    501501 
    502   Gravity* gravity = new Gravity();
    503   gravity->setMagnitude(0.001);
     502  Field* twirl = new Twirl();
     503  twirl->setMagnitude(.0001);
     504  Field* gravity = new PointGravity();
     505  gravity->setMagnitude(0.0001);
     506  new PhysicsConnection(system, twirl);
    504507  new PhysicsConnection(system, gravity);
    505 
     508  twirl->setParent(this->localPlayer);
     509  gravity->setParent(this->localCamera->getTarget());
    506510  particleEngine->addConnection(emitter, system);
    507511}
  • orxonox/branches/physics/src/util/physics/fields/point_gravity.cc

    r4182 r4184  
    1616//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
    1717
    18 #include "gravity.h"
     18#include "point_gravity.h"
    1919
    2020using namespace std;
     
    2525   \todo this constructor is not jet implemented - do it
    2626*/
    27 Gravity::Gravity ()
     27PointGravity::PointGravity ()
    2828{
    29    this->setClassName ("Gravity");
     29   this->setClassName ("PointGravity");
    3030}
    3131
     
    3535
    3636*/
    37 Gravity::~Gravity ()
     37PointGravity::~PointGravity ()
    3838{
    3939  // delete what has to be deleted here
     
    4141
    4242/**
    43    \brief calculates the Gravity on any point in space
    44    \param data The Position of the Point in space to attache gravity to.
     43   \brief calculates the PointGravity on any point in space
     44   \param data The Position of the Point in space to attache PointGravity to.
    4545   \returns The force.
    4646*/
    47 Vector Gravity::calcForce(const Vector& data) const
     47Vector PointGravity::calcForce(const Vector& data) const
    4848{
    49   return /*(this->getAbsDir().apply(Vector(0,1,0)))*/ Vector(0,-1,0) * this->getMagnitude();
     49  return (this->getAbsCoor() - data) * this->getMagnitude();
    5050}
    5151
  • orxonox/branches/physics/src/util/physics/fields/point_gravity.h

    r4182 r4184  
    11/*!
    2     \file gravity.h
     2    \file point_gravity.h
    33    \brief Definition of ...
    44
    55*/
    66
    7 #ifndef _GRAVITY_H
    8 #define _GRAVITY_H
     7#ifndef _POINT_GRAVITY_H
     8#define _POINT_GRAVITY_H
    99
    1010#include "field.h"
     
    1515
    1616//! A class for ...
    17 class Gravity : public Field {
     17class PointGravity : public Field {
    1818
    1919 public:
    20   Gravity();
    21   virtual ~Gravity();
     20  PointGravity();
     21  virtual ~PointGravity();
    2222
    2323  virtual Vector calcForce(const Vector& data) const;
     
    2727};
    2828
    29 #endif /* _GRAVITY_H */
     29#endif /* _POINT_GRAVITY_H */
  • orxonox/branches/physics/src/util/physics/fields/twirl.cc

    r4182 r4184  
    1616//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
    1717
    18 #include "gravity.h"
     18#include "twirl.h"
    1919
    2020using namespace std;
     
    2525   \todo this constructor is not jet implemented - do it
    2626*/
    27 Gravity::Gravity ()
     27Twirl::Twirl ()
    2828{
    29    this->setClassName ("Gravity");
     29   this->setClassName ("Twirl");
    3030}
    3131
     
    3535
    3636*/
    37 Gravity::~Gravity ()
     37Twirl::~Twirl ()
    3838{
    3939  // delete what has to be deleted here
     
    4141
    4242/**
    43    \brief calculates the Gravity on any point in space
    44    \param data The Position of the Point in space to attache gravity to.
     43   \brief calculates the Twirl on any point in space
     44   \param data The Position of the Point in space to attache twirl to.
    4545   \returns The force.
    4646*/
    47 Vector Gravity::calcForce(const Vector& data) const
     47Vector Twirl::calcForce(const Vector& data) const
    4848{
    49   return /*(this->getAbsDir().apply(Vector(0,1,0)))*/ Vector(0,-1,0) * this->getMagnitude();
     49  return /*this->getAbsDir()*/ Vector(0,1,0).cross(this->getAbsCoor() - data)
     50    * this->getMagnitude();
    5051}
    5152
  • orxonox/branches/physics/src/util/physics/fields/twirl.h

    r4182 r4184  
    11/*!
    2     \file gravity.h
     2    \file twirl.h
    33    \brief Definition of ...
    44
    55*/
    66
    7 #ifndef _GRAVITY_H
    8 #define _GRAVITY_H
     7#ifndef _TWIRL_H
     8#define _TWIRL_H
    99
    1010#include "field.h"
     
    1515
    1616//! A class for ...
    17 class Gravity : public Field {
     17class Twirl : public Field {
    1818
    1919 public:
    20   Gravity();
    21   virtual ~Gravity();
     20  Twirl();
     21  virtual ~Twirl();
    2222
    2323  virtual Vector calcForce(const Vector& data) const;
     
    2727};
    2828
    29 #endif /* _GRAVITY_H */
     29#endif /* _TWIRL_H */
  • orxonox/branches/physics/src/util/physics/physics_engine.h

    r4183 r4184  
    1010#include "base_object.h"
    1111#include "physics_connection.h"
    12 #include "field.h"
     12#include "fields.h"
    1313
    1414// Forward Declaration
Note: See TracChangeset for help on using the changeset viewer.