Changeset 4184 in orxonox.OLD for orxonox/branches
- Timestamp:
- May 14, 2005, 10:27:47 PM (20 years ago)
- Location:
- orxonox/branches/physics/src
- Files:
-
- 1 added
- 4 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/physics/src/Makefile.am
r4181 r4184 93 93 util/physics/fields/field.cc \ 94 94 util/physics/fields/gravity.cc \ 95 util/physics/fields/point_gravity.cc \ 96 util/physics/fields/twirl.cc \ 95 97 lib/math/vector.cc \ 96 98 lib/math/curve.cc \ … … 165 167 util/physics/physical_interaction_asym.h \ 166 168 util/physics/physics_connection.h \ 169 util/physics/fields/fields.h \ 167 170 util/physics/fields/field.h \ 168 171 util/physics/fields/gravity.h \ 172 util/physics/fields/point_gravity.h \ 173 util/physics/fields/twirl.h \ 169 174 lib/util/ini_parser.h \ 170 175 lib/math/vector.h \ -
orxonox/branches/physics/src/Makefile.in
r4181 r4184 93 93 physical_interaction_asym.$(OBJEXT) \ 94 94 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) \ 97 98 tinyxmlparser.$(OBJEXT) benchmark.$(OBJEXT) 98 99 orxonox_OBJECTS = $(am_orxonox_OBJECTS) … … 142 143 @AMDEP_TRUE@ ./$(DEPDIR)/physics_connection.Po \ 143 144 @AMDEP_TRUE@ ./$(DEPDIR)/physics_engine.Po \ 144 @AMDEP_TRUE@ ./$(DEPDIR)/player.Po \145 @AMDEP_TRUE@ ./$(DEPDIR)/player.Po ./$(DEPDIR)/point_gravity.Po \ 145 146 @AMDEP_TRUE@ ./$(DEPDIR)/primitive_model.Po \ 146 147 @AMDEP_TRUE@ ./$(DEPDIR)/projectile.Po \ … … 155 156 @AMDEP_TRUE@ ./$(DEPDIR)/tinyxmlparser.Po \ 156 157 @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.Po158 @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 160 161 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 161 162 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) … … 346 347 util/physics/fields/field.cc \ 347 348 util/physics/fields/gravity.cc \ 349 util/physics/fields/point_gravity.cc \ 350 util/physics/fields/twirl.cc \ 348 351 lib/math/vector.cc \ 349 352 lib/math/curve.cc \ … … 418 421 util/physics/physical_interaction_asym.h \ 419 422 util/physics/physics_connection.h \ 423 util/physics/fields/fields.h \ 420 424 util/physics/fields/field.h \ 421 425 util/physics/fields/gravity.h \ 426 util/physics/fields/point_gravity.h \ 427 util/physics/fields/twirl.h \ 422 428 lib/util/ini_parser.h \ 423 429 lib/math/vector.h \ … … 587 593 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/physics_engine.Po@am__quote@ 588 594 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/player.Po@am__quote@ 595 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/point_gravity.Po@am__quote@ 589 596 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/primitive_model.Po@am__quote@ 590 597 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/projectile.Po@am__quote@ … … 605 612 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track_manager.Po@am__quote@ 606 613 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track_node.Po@am__quote@ 614 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twirl.Po@am__quote@ 607 615 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@ 608 616 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/weapon.Po@am__quote@ … … 1569 1577 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1570 1578 @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 1580 point_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 1588 point_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 1596 twirl.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 1604 twirl.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` 1571 1611 1572 1612 vector.o: lib/math/vector.cc -
orxonox/branches/physics/src/story_entities/world.cc
r4183 r4184 492 492 493 493 494 ParticleSystem* system = new ParticleSystem(1000 , PARTICLE_SPRITE);495 system->setLifeSpan( .5);496 system->setConserve(.9 9);494 ParticleSystem* system = new ParticleSystem(100000, PARTICLE_SPARK); 495 system->setLifeSpan(5); 496 system->setConserve(.9); 497 497 system->setRadius(2, 0, 2, 0); 498 498 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); 500 500 emitter->setParent(this->localPlayer); 501 501 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); 504 507 new PhysicsConnection(system, gravity); 505 508 twirl->setParent(this->localPlayer); 509 gravity->setParent(this->localCamera->getTarget()); 506 510 particleEngine->addConnection(emitter, system); 507 511 } -
orxonox/branches/physics/src/util/physics/fields/point_gravity.cc
r4182 r4184 16 16 //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ 17 17 18 #include " gravity.h"18 #include "point_gravity.h" 19 19 20 20 using namespace std; … … 25 25 \todo this constructor is not jet implemented - do it 26 26 */ 27 Gravity::Gravity ()27 PointGravity::PointGravity () 28 28 { 29 this->setClassName (" Gravity");29 this->setClassName ("PointGravity"); 30 30 } 31 31 … … 35 35 36 36 */ 37 Gravity::~Gravity ()37 PointGravity::~PointGravity () 38 38 { 39 39 // delete what has to be deleted here … … 41 41 42 42 /** 43 \brief calculates the Gravity on any point in space44 \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. 45 45 \returns The force. 46 46 */ 47 Vector Gravity::calcForce(const Vector& data) const47 Vector PointGravity::calcForce(const Vector& data) const 48 48 { 49 return /*(this->getAbsDir().apply(Vector(0,1,0)))*/ Vector(0,-1,0) * this->getMagnitude();49 return (this->getAbsCoor() - data) * this->getMagnitude(); 50 50 } 51 51 -
orxonox/branches/physics/src/util/physics/fields/point_gravity.h
r4182 r4184 1 1 /*! 2 \file gravity.h2 \file point_gravity.h 3 3 \brief Definition of ... 4 4 5 5 */ 6 6 7 #ifndef _ GRAVITY_H8 #define _ GRAVITY_H7 #ifndef _POINT_GRAVITY_H 8 #define _POINT_GRAVITY_H 9 9 10 10 #include "field.h" … … 15 15 16 16 //! A class for ... 17 class Gravity : public Field {17 class PointGravity : public Field { 18 18 19 19 public: 20 Gravity();21 virtual ~ Gravity();20 PointGravity(); 21 virtual ~PointGravity(); 22 22 23 23 virtual Vector calcForce(const Vector& data) const; … … 27 27 }; 28 28 29 #endif /* _ GRAVITY_H */29 #endif /* _POINT_GRAVITY_H */ -
orxonox/branches/physics/src/util/physics/fields/twirl.cc
r4182 r4184 16 16 //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ 17 17 18 #include " gravity.h"18 #include "twirl.h" 19 19 20 20 using namespace std; … … 25 25 \todo this constructor is not jet implemented - do it 26 26 */ 27 Gravity::Gravity()27 Twirl::Twirl () 28 28 { 29 this->setClassName (" Gravity");29 this->setClassName ("Twirl"); 30 30 } 31 31 … … 35 35 36 36 */ 37 Gravity::~Gravity()37 Twirl::~Twirl () 38 38 { 39 39 // delete what has to be deleted here … … 41 41 42 42 /** 43 \brief calculates the Gravityon any point in space44 \param data The Position of the Point in space to attache gravityto.43 \brief calculates the Twirl on any point in space 44 \param data The Position of the Point in space to attache twirl to. 45 45 \returns The force. 46 46 */ 47 Vector Gravity::calcForce(const Vector& data) const47 Vector Twirl::calcForce(const Vector& data) const 48 48 { 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(); 50 51 } 51 52 -
orxonox/branches/physics/src/util/physics/fields/twirl.h
r4182 r4184 1 1 /*! 2 \file gravity.h2 \file twirl.h 3 3 \brief Definition of ... 4 4 5 5 */ 6 6 7 #ifndef _ GRAVITY_H8 #define _ GRAVITY_H7 #ifndef _TWIRL_H 8 #define _TWIRL_H 9 9 10 10 #include "field.h" … … 15 15 16 16 //! A class for ... 17 class Gravity: public Field {17 class Twirl : public Field { 18 18 19 19 public: 20 Gravity();21 virtual ~ Gravity();20 Twirl(); 21 virtual ~Twirl(); 22 22 23 23 virtual Vector calcForce(const Vector& data) const; … … 27 27 }; 28 28 29 #endif /* _ GRAVITY_H */29 #endif /* _TWIRL_H */ -
orxonox/branches/physics/src/util/physics/physics_engine.h
r4183 r4184 10 10 #include "base_object.h" 11 11 #include "physics_connection.h" 12 #include "field .h"12 #include "fields.h" 13 13 14 14 // Forward Declaration
Note: See TracChangeset
for help on using the changeset viewer.