Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 14, 2005, 1:15:25 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches/physics: connection of Physical effects should work on ParticleSystems

File:
1 edited

Legend:

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

    r4181 r4182  
    1717
    1818#include "physics_connection.h"
    19 
     19#include "field.h"
     20#include "particle_system.h"
    2021
    2122using namespace std;
    2223
    2324
    24 /**
    25    \brief standard constructor
    26 */
    27 PhysicsConnection::PhysicsConnection ()
     25
     26PhysicsConnection::PhysicsConnection(ParticleSystem* particleSystem, Field* field)
    2827{
    29    this->setClassName ("PhysicsConnection");
    30    connection = NULL;
     28  this->type = PCON_ParticlesField;
     29  this->particleSystem = particleSystem;
     30  this->field = field;
    3131}
    3232
     
    3838PhysicsConnection::~PhysicsConnection ()
    3939{
    40   if (this->connection)
    41     delete this->connection;
     40
    4241}
    4342
     43/**
     44    \brief applies the Force to some Object.
     45*/
     46void PhysicsConnection::apply(void) const
     47{
     48  switch(this->type)
     49    {
     50    case PCON_IPhysField:
     51     
     52      break;
    4453
     54    case PCON_ParticlesField:
     55      this->particleSystem->applyField(this->field);
    4556
     57      break;
     58     
     59    case PCON_IPhysIPhys:
    4660
    47 
    48 
    49 bool PhysicsConnection::addConnection(ParticleSystem* particleSystem, Field* field)
    50 {
    51   if (!this->connection)
    52     {
    53       this->connection = new PhysConnection;
    54       this->connection->type = PCON_ParticlesField;
    55       this->connection->particleSystem = particleSystem;
    56       this->connection->field = field;
     61      break;
    5762    }
    5863}
Note: See TracChangeset for help on using the changeset viewer.