Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/lib/physics/physics_connection.cc @ 4377

Last change on this file since 4377 was 4377, checked in by bensch, 19 years ago

orxonox/trunk: ParticleSystem is now a PhysicsInterface

File size: 1.3 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_
17
18#include "physics_connection.h"
19
20#include "physics_engine.h"
21
22#include "field.h"
23#include "particle_system.h"
24#include "physics_interface.h"
25
26using namespace std;
27
28
29
30PhysicsConnection::PhysicsConnection(PhysicsInterface* subject, Field* field)
31{
32  this->type = PCON_PhysIField;
33  this->subject = subject;
34  this->field = field;
35
36  PhysicsEngine::getInstance()->addConnection(this);
37}
38
39
40/**
41   \brief standard deconstructor
42
43*/
44PhysicsConnection::~PhysicsConnection () 
45{
46  PhysicsEngine::getInstance()->removeConnection(this);
47}
48
49/**
50    \brief applies the Force to some Object.
51    \param dt The time to apply in Seconds
52*/
53void PhysicsConnection::apply(const float& dt) const
54{
55  switch(this->type)
56    {
57    case PCON_PhysIField:
58     
59      break;
60
61    case PCON_PhysIPhysI:
62      this->subject->applyField(this->field, dt);
63      break;
64    }
65}
Note: See TracBrowser for help on using the repository browser.