Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


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/util/physics
Files:
1 added
1 edited
4 copied

Legend:

Unmodified
Added
Removed
  • 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.