Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


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

orxonox/branches/physics: definition of the ground-class: field

Location:
orxonox/branches/physics/src/util/physics
Files:
2 copied

Legend:

Unmodified
Added
Removed
  • orxonox/branches/physics/src/util/physics/field.cc

    r4178 r4179  
    1010
    1111   ### File Specific:
    12    main-programmer: ...
     12   main-programmer: Benjamin Grauer
    1313   co-programmer: ...
    1414*/
     
    1616//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
    1717
    18 #include "proto_class.h"
     18#include "field.h"
    1919
    2020using namespace std;
     
    2525   \todo this constructor is not jet implemented - do it
    2626*/
    27 ProtoClass::ProtoClass ()
     27Field::Field ()
    2828{
    29    this->setClassName ("ProtoClass");
     29   this->setClassName ("Field");
    3030}
    3131
     
    3535
    3636*/
    37 ProtoClass::~ProtoClass ()
     37Field::~Field ()
    3838{
    3939  // delete what has to be deleted here
    4040}
     41
     42
     43/**
     44   \param magnitude the magnitude of the Field.
     45*/
     46void Field::setMagnitude(const float& magnitude)
     47{
     48  this->magnitude = magnitude;
     49}
     50
     51/**
     52   \param attenuation The attenuation of the Field (the bigger the smaller the region of influence)
     53*/
     54void Field::setAttenuation(const float& attenuation)
     55{
     56  this->attenuation = attenuation;
     57}
  • orxonox/branches/physics/src/util/physics/field.h

    r4178 r4179  
    1 /*!
    2     \file proto_class.h
    3     \brief Definition of ...
     1/*
     2   orxonox - the future of 3D-vertical-scrollers
    43
     4   Copyright (C) 2004 orx
     5
     6   This program is free software; you can redistribute it and/or modify
     7   it under the terms of the GNU General Public License as published by
     8   the Free Software Foundation; either version 2, or (at your option)
     9   any later version.
     10
     11   ### File Specific:
     12   main-programmer: Benjamin Grauer
     13   co-programmer: ...
    514*/
    615
    7 #ifndef _PROTO_CLASS_H
    8 #define _PROTO_CLASS_H
     16/*!
     17    \file field.h
     18    \brief abstract definition of a Physical Field
    919
    10 #include "base_object.h"
     20    This is a totally abstract class, that only enables different Physical Fields to
     21    exist on a common Level.
     22*/
     23
     24#ifndef _FIELD_H
     25#define _FIELD_H
     26
     27#include "p_node.h"
    1128
    1229// FORWARD DEFINITION
     
    1431
    1532
    16 //! A class for ...
    17 class ProtoClass : public BaseObject {
     33//! An abstract class that represents a Force.
     34class Field : public PNode
     35{
     36 public:
     37  Field();
     38  virtual ~Field();
    1839
    19  public:
    20   ProtoClass();
    21   virtual ~ProtoClass();
     40  /**
     41      \param data This is the data given to this force, to calculate the ForceVector
     42      \returns The Force Vector
     43  */
     44  virtual Vector& calcForce(Vector& data) = 0;
    2245
     46  void setMagnitude(const float& magnitude);
     47  /** \returns The Magnitude of the Field */
     48  const float& getMagnitude(void) const {return this->magnitude;}
     49
     50  void setAttenuation(const float& attenuation);
     51  /** \returns The Attenuation of the Fiels */
     52  const float& getAttenuation(void) const {return this->attenuation;}
    2353
    2454 private:
    25 
     55  float magnitude;                //!< The strength of the field
     56  float attenuation;              //!< The Attenuation (the bigger the shorter the influenced distance).
    2657};
    2758
    28 #endif /* _PROTO_CLASS_H */
     59#endif /* _FIELD_H */
Note: See TracChangeset for help on using the changeset viewer.