Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/test/src/lib/physics/fields/gravity.cc @ 10772

Last change on this file since 10772 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.2 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#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_PHYSICS
17
18#include "gravity.h"
19
20#include "util/loading/load_param.h"
21#include "util/loading/factory.h"
22
23#include "class_id_DEPRECATED.h"
24ObjectListDefinitionID(Gravity, CL_FIELD_GRAVITY);
25
26CREATE_FACTORY(Gravity);
27
28Gravity::Gravity(const TiXmlElement* root)
29{
30  this->registerObject(this, Gravity::_objectList);
31
32  if (root != NULL)
33    this->loadParams(root);
34}
35
36/**
37 *  standard deconstructor
38
39*/
40Gravity::~Gravity ()
41{
42  // delete what has to be deleted here
43}
44
45void Gravity::loadParams(const TiXmlElement* root)
46{
47  Field::loadParams(root);
48}
49
50/**
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.
54*/
55Vector Gravity::calcForce(const Vector& data) const
56{
57  return Vector(0,-1,0) * this->getMagnitude();
58}
59
60
Note: See TracBrowser for help on using the repository browser.