source:
orxonox.OLD/trunk/src/lib/physics/fields/gravity.cc
@
10765
Last change on this file since 10765 was 10114, checked in by patrick, 18 years ago | |
---|---|
File size: 1.2 KB |
Rev | Line | |
---|---|---|
[4728] | 1 | /* |
[1853] | 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. | |
[1855] | 10 | |
11 | ### File Specific: | |
[4730] | 12 | main-programmer: Benjamin Grauer |
[1855] | 13 | co-programmer: ... |
[1853] | 14 | */ |
15 | ||
[5357] | 16 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_PHYSICS |
[1853] | 17 | |
[4180] | 18 | #include "gravity.h" |
[1853] | 19 | |
[7193] | 20 | #include "util/loading/load_param.h" |
21 | #include "util/loading/factory.h" | |
[4728] | 22 | |
[1853] | 23 | |
[10114] | 24 | ObjectListDefinition(Gravity); |
25 | ||
[9869] | 26 | CREATE_FACTORY(Gravity); |
[9406] | 27 | |
[4728] | 28 | Gravity::Gravity(const TiXmlElement* root) |
29 | { | |
[9869] | 30 | this->registerObject(this, Gravity::_objectList); |
[1853] | 31 | |
[4742] | 32 | if (root != NULL) |
33 | this->loadParams(root); | |
[4728] | 34 | } |
35 | ||
[3245] | 36 | /** |
[4836] | 37 | * standard deconstructor |
[1853] | 38 | |
[3245] | 39 | */ |
[4728] | 40 | Gravity::~Gravity () |
[3543] | 41 | { |
42 | // delete what has to be deleted here | |
43 | } | |
[4180] | 44 | |
[4728] | 45 | void Gravity::loadParams(const TiXmlElement* root) |
46 | { | |
[6512] | 47 | Field::loadParams(root); |
[4728] | 48 | } |
49 | ||
[4180] | 50 | /** |
[4836] | 51 | * calculates the Gravity on any point in space |
52 | * @param data The Position of the Point in space to attache gravity to. | |
53 | * @returns The force. | |
[4180] | 54 | */ |
[4395] | 55 | Vector Gravity::calcForce(const Vector& data) const |
[4180] | 56 | { |
[4396] | 57 | return Vector(0,-1,0) * this->getMagnitude(); |
[4180] | 58 | } |
59 | ||
60 |
Note: See TracBrowser
for help on using the repository browser.