Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/heathaze/src/lib/physics/fields/field.h @ 10764

Last change on this file since 10764 was 9869, checked in by bensch, 18 years ago

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

File size: 1.6 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
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: ...
14*/
15
16/*!
17 * @file field.h
18 * abstract definition of a Physical Field
19 *
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"
28
29// FORWARD DECLARATION
30class TiXmlElement;
31
32
33//! An abstract class that represents a Force.
34class Field : public PNode
35{
36  ObjectListDeclaration(Field);
37 public:
38  Field();
39  virtual ~Field();
40
41  void init();
42  virtual void loadParams(const TiXmlElement* root);
43
44  /**
45    * @param data This is the data given to this force, to calculate the ForceVector
46    * @returns The Force Vector
47  */
48  virtual Vector calcForce(const Vector& data) const = 0;
49
50  void setMagnitude(float magnitude);
51  /** @returns The Magnitude of the Field */
52  inline const float& getMagnitude() const {return this->magnitude;}
53
54  void setAttenuation(float attenuation);
55  /** @returns The Attenuation of the Fiels */
56  inline const float& getAttenuation() const {return this->attenuation;}
57
58 private:
59  float magnitude;                //!< The strength of the field
60  float attenuation;              //!< The Attenuation (the bigger the shorter the influenced distance).
61};
62
63#endif /* _FIELD_H */
Note: See TracBrowser for help on using the repository browser.