Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 592


Ignore:
Timestamp:
Dec 17, 2007, 8:59:31 PM (16 years ago)
Author:
nicolasc
Message:

added engineglow particle effect - based of treibwerk
other various changes

Location:
code/branches/FICN
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/bin/levels/sample.oxw

    r591 r592  
    99    <bar top="200" left="50" width="300" height="20" image="textures/load_screens/ambush-loadbar.png" />
    1010  </loading>
     11
    1112
    1213
     
    2930    <Skybox src="Orxonox/StarfieldSkyBox" />
    3031
     32
    3133    <SceneNode name="ShipNode" pos="0,0,0" node="OgreHeadNode" scale="10,10,10" yaw="-90" pitch="-90" />
    3234    <BaseEntity name="TheShip" src="assf2.mesh" node="ShipNode" />
     
    3840    <BaseEntity name="TheShip3" src="assf2.mesh" node="ShipNode3" />
    3941
     42<<<<<<< .mine
     43
     44    <SceneNode name="node1" pos="0,2000,0"  scale="40,40,40" />
     45    <Entity name="asteroid1" src="ast1.mesh" node="node1" />
     46
     47    <SceneNode name="node2" pos="2000,0,0" scale="20,20,20"/>
     48    <Entity name="asteroid2" src="ast2.mesh" node="node2" />
     49=======
    4050    <Model position="0,2000,0" scale="40" mesh="ast1.mesh" />
    4151    <Model position="2000,0,0" scale="20" mesh="ast2.mesh" />
     
    4555    <Model position="0,0,-2000" scale="20" mesh="ast6.mesh" />
    4656    <Model position="1000,1500,0" scale="50" mesh="ast1.mesh" />
     57>>>>>>> .r591
    4758
     59<<<<<<< .mine
     60    <SceneNode name="node3" pos="0,0,2000" scale="20,20,20"/>
     61    <Entity name="aststeroid3" src="ast3.mesh" node="node3"/>
     62
     63    <SceneNode name="node4" pos="0,-2000,0" scale="20,20,20"/>
     64    <Entity name="asteroid4" src="ast4.mesh" node="node4" />
     65
     66    <SceneNode name="node5" pos="-2000,0,0" scale="20,20,20"/>
     67    <Entity name="asteroid5" src="ast5.mesh" node="node5" />
     68
     69    <SceneNode name="node6" pos="0,0,-2000" scale="20,20,20"/>
     70    <Entity name="asteroid6" src="ast6.mesh" node="node6" />
     71
     72    <SceneNode name="node7" pos="1000,1500,0"  scale="50,50,50" />
     73    <Entity name="asteroid7" src="ast1.mesh" node="node7" />
     74
     75
     76=======
     77>>>>>>> .r591
    4878  </world>
    4979
  • code/branches/FICN/src/misc/String2Number.h

    r560 r592  
    1515* Number in string can be decimal, hexadecimal or octal
    1616*
    17 * @autor Nicolas Perrenoud<nicolape@ee.ethz.ch>
     17* @author Nicolas Perrenoud<nicolape@ee.ethz.ch>
    1818*
    1919* @example
  • code/branches/FICN/src/misc/Tokenizer.h

    r507 r592  
    1212* Returns the result as a vector<string> object
    1313*
    14 * @autor Nicolas Perrenoud<nicolape@ee.ethz.ch>
     14* @author Nicolas Perrenoud<nicolape@ee.ethz.ch>
    1515*/
    1616
     
    1818{
    1919        vector<std::string> tokens;
    20        
     20
    2121  // Skip delimiters at beginning.
    2222  std::string::size_type lastPos = str.find_first_not_of(delimiters, 0);
     
    3232      // Find next "non-delimiter"
    3333      pos = str.find_first_of(delimiters, lastPos);
    34   }     
    35   return tokens;   
     34  }
     35  return tokens;
    3636}
    3737
  • code/branches/FICN/src/network/CMakeLists.txt

    r555 r592  
    7171  #objects
    7272  ${ENet_LIBRARY}
    73   ${Zlib_LIBRARY}
     73  ${ZLIB_LIBRARY}
    7474  ${WINDOWS_ENET_DEPENDENCIES}
    7575)
     
    8282  #objects
    8383  ${ENet_LIBRARY}
    84   ${Zlib_LIBRARY}
     84  ${ZLIB_LIBRARY}
    8585  ${WINDOWS_ENET_DEPENDENCIES}
    8686)
  • code/branches/FICN/src/network/PacketTypes.h

    r436 r592  
    22// C++ Interface: PacketTypes
    33//
    4 // Description: 
     4// Description:
    55//
    66//
     
    2525
    2626
    27 /**
    28  * This struct defines a gamestate:
    29  * size: total size of the data in *data
    30  * data: pointer to the data allocated in the memory
    31  */
     27  /**
     28   * This struct defines a gamestate:
     29   * size: total size of the data in *data
     30   * data: pointer to the data allocated in the memory
     31   */
    3232  struct GameState{
    3333    int id;
    34     int size;
     34    int size;                       //!< total size of data
    3535    // new ---- change functions
    3636    bool diffed;
    37     unsigned char *data;
     37    unsigned char *data;            //!< pointer to data
    3838  };
    3939
    40 /**
    41  * this struct defines a gamestate:
     40  /**
     41   * this struct defines a gamestate:
    4242   * compsize is the size of the compressed data
    4343   * normsize is the size of the uncompressed data
    4444   * data are the gamestates
    45  */
     45   */
    4646  struct GameStateCompressed{
    47     int id; 
    48     int compsize;
    49     int normsize;
     47    int id;
     48    int compsize;                   //!< size of compressed data
     49    int normsize;                   //!< size of uncompressed data
    5050    // new ----- change functions
    5151    bool diffed;
    52     unsigned char *data;
     52    unsigned char *data;            //!< gamestate data
    5353  };
    5454
     
    5959    const char *message;
    6060  };
    61  
    62  
     61
     62
    6363  struct ack {
    6464    int id;
  • code/branches/FICN/src/network/Synchronisable.cc

    r573 r592  
    116116  for(i=syncList.begin(); n<datasize && i!=syncList.end(); ++i){
    117117    COUT(2) << "size of variable: " << i->size << std::endl;
     118    COUT(2) << "size of variable: " << i->size << std::endl;
    118119    //COUT(2) << "size of variable: " << i->size << std::endl;
    119120    //(std::memcpy(retVal.data+n, (const void*)(&(i->size)), sizeof(int));
  • code/branches/FICN/src/orxonox/core/ConfigValueContainer.cc

    r513 r592  
    654654
    655655    /**
    656         @param Writes the content of the list, containing all lines of the config-file, into the config-file.
    657         @param filename The name of the config-file
    658     */
     656     *  @param Writes the content of the list, containing all lines of the config-file, into the config-file.
     657     *  @param filename The name of the config-file
     658     */
    659659    void ConfigValueContainer::writeConfigFile(const std::string& filename)
    660660    {
  • code/branches/FICN/src/orxonox/core/Identifier.h

    r496 r592  
    6767
    6868        public:
    69             /** @brief Sets the Factory. @param facotry The factory to assign */
     69            /** @brief Sets the Factory.
     70             *  @param factory The factory to assign
     71             */
    7072            inline void addFactory(BaseFactory* factory) { this->factory_ = factory; }
    7173
  • code/branches/FICN/src/orxonox/orxonox.cc

    r588 r592  
    467467    particle::ParticleInterface *e = new particle::ParticleInterface(mgr,"engine","Orxonox/strahl");
    468468    e->particleSystem_->setParameter("local_space","true");
    469     e->setPositionOfEmitter(0, Vector3(0,-10,200));
     469    e->setPositionOfEmitter(0, Vector3(0,-10,0));
    470470    e->setDirection(Vector3(0,0,-1));
    471471    e->addToSceneNode(node);
     
    480480    w->addToSceneNode(node);
    481481
    482     particle::ParticleInterface *tt = new particle::ParticleInterface(mgr,"thrusters","Orxonox/treibwerk");
     482    particle::ParticleInterface *tt = new particle::ParticleInterface(mgr,"twinthruster","Orxonox/engineglow");
    483483    tt->particleSystem_->setParameter("local_space","true");
    484484    tt->newEmitter();
    485     tt->setDirection(Vector3(0,0,1));
    486     tt->setPositionOfEmitter(0, Vector3(15,0,-60));
    487     tt->setPositionOfEmitter(1, Vector3(-15,0,-60));
     485    tt->setDirection(Vector3(0,0,-1));
     486    tt->setPositionOfEmitter(0, Vector3(20,-1,-15));
     487    tt->setPositionOfEmitter(1, Vector3(-20,-1,-15));
    488488    tt->addToSceneNode(node);
    489 
    490489
    491490  }
  • code/branches/FICN/src/orxonox/orxonox_ship.h

    r346 r592  
    4141  public:
    4242    OrxonoxShip(Ogre::SceneNode*);
    43           virtual ~OrxonoxShip();
     43    virtual ~OrxonoxShip();
    4444
    45           virtual bool initialise();
     45    virtual bool initialise();
    4646
    47           void setMainThrust(const Ogre::Real);
    48           void setSideThrust(const Ogre::Real);
     47    void setMainThrust(const Ogre::Real);
     48    void setSideThrust(const Ogre::Real);
    4949    void setYThrust(const Ogre::Real);
    50           void turnUpAndDown(const Ogre::Radian&);
    51           void turnLeftAndRight(const Ogre::Radian&);
     50    void turnUpAndDown(const Ogre::Radian&);
     51    void turnLeftAndRight(const Ogre::Radian&);
    5252
    5353    InertialNode* getRootNode();
     
    5858    int getAmmoStock();
    5959
    60           bool tick(unsigned long, Ogre::Real);
     60    bool tick(unsigned long, Ogre::Real);
    6161
    6262  protected:
    6363
    6464  protected:
    65           Ogre::SceneManager *sceneMgr_;
    66           //Ogre::SceneNode *rootNode_;
     65    Ogre::SceneManager *sceneMgr_;
     66    //Ogre::SceneNode *rootNode_;
    6767    InertialNode *rootNode_;
    68           Ogre::Entity *shipEntity_;
     68    Ogre::Entity *shipEntity_;
    6969
    70           //Ogre::Vector3 currentSpeed_;  // relative to space
    71           Ogre::Vector3 currentThrust_; // relative to the ship
     70    //Ogre::Vector3 currentSpeed_;  // relative to space
     71    Ogre::Vector3 currentThrust_; // relative to the ship
    7272    Ogre::Real baseThrust_;
    73           int objectCounter_;
     73    int objectCounter_;
    7474
    7575    weapon::BulletManager *bulletManager_;
    76           //Ogre::Vector3 bulletSpeed_;
     76    //Ogre::Vector3 bulletSpeed_;
    7777
    7878    weapon::BaseWeapon *mainWeapon_;
  • code/branches/FICN/src/orxonox/particle/ParticleInterface.cc

    r544 r592  
    3737namespace particle {
    3838
    39         ParticleInterface::~ParticleInterface(void)
    40         {
    41                 sceneManager_->destroyParticleSystem(particleSystem_);
     39  ParticleInterface::~ParticleInterface(void)
     40  {
     41    sceneManager_->destroyParticleSystem(particleSystem_);
    4242
    43                 delete sceneNode_;
    44                 delete particleSystem_;
    45                 delete sceneManager_;
    46         }
     43    delete sceneNode_;
     44    delete particleSystem_;
     45    delete sceneManager_;
     46  }
    4747
    48         ParticleInterface::ParticleInterface( SceneManager *sceneManager, String name, String templateName )
    49         {
    50                 sceneManager_ = sceneManager;
    51                 particleSystem_ = sceneManager->createParticleSystem(name, templateName);
     48  ParticleInterface::ParticleInterface( SceneManager *sceneManager, String name, String templateName )
     49  {
     50    sceneManager_ = sceneManager;
     51    particleSystem_ = sceneManager->createParticleSystem(name, templateName);
    5252
    53                 //Variabeln einlesen, Emitter1_ ist Referenz-Emitter
    54                 velocity_ = particleSystem_->getSpeedFactor();
    55                 colour_ = particleSystem_->getEmitter(0)->getColour();
    56                 rate_ = particleSystem_->getEmitter(0)->getEmissionRate();
    57                 distance_ = particleSystem_->getEmitter(0)->getTimeToLive();
     53    //Variabeln einlesen, Emitter1_ ist Referenz-Emitter
     54    velocity_ = particleSystem_->getSpeedFactor();
     55    colour_ = particleSystem_->getEmitter(0)->getColour();
     56    rate_ = particleSystem_->getEmitter(0)->getEmissionRate();
     57    distance_ = particleSystem_->getEmitter(0)->getTimeToLive();
    5858
    59                 //Anzahl der Emitter
    60                 numberOfEmitters_ = particleSystem_->getNumEmitters();
    61                 standardizeEmitters();
    62         }
     59    //Anzahl der Emitter
     60    numberOfEmitters_ = particleSystem_->getNumEmitters();
     61    standardizeEmitters();
     62  }
    6363
    64         void ParticleInterface::standardizeEmitters(void)
    65         {
    66                 //Abgleichen der anderen Emitter an die Variabeln
    67                 for (int i=1; i<numberOfEmitters_; i++) {
    68                         particleSystem_->getEmitter(i)->setColour( colour_ );
    69                         particleSystem_->getEmitter(i)->setTimeToLive( distance_ );
    70                         particleSystem_->getEmitter(i)->setEmissionRate( rate_ );
    71                 }
     64  void ParticleInterface::standardizeEmitters(void)
     65  {
     66    //Abgleichen der anderen Emitter an die Variabeln
     67    for (int i=1; i<numberOfEmitters_; i++) {
     68      particleSystem_->getEmitter(i)->setColour( colour_ );
     69      particleSystem_->getEmitter(i)->setTimeToLive( distance_ );
     70      particleSystem_->getEmitter(i)->setEmissionRate( rate_ );
     71    }
    7272
    73         }
     73  }
    7474
    75         void ParticleInterface::addToSceneNode( SceneNode* sceneNode )
    76         {
    77                 sceneNode_ = sceneNode;
    78                 sceneNode_->attachObject(particleSystem_);
    79         }
     75  void ParticleInterface::addToSceneNode( SceneNode* sceneNode )
     76  {
     77    sceneNode_ = sceneNode;
     78    sceneNode_->attachObject(particleSystem_);
     79  }
    8080
    81         void ParticleInterface::dettachFromSceneNode ( void )
    82         {
    83                 sceneNode_->detachObject(particleSystem_);
    84                 sceneNode_ = NULL;
    85         }
     81  void ParticleInterface::dettachFromSceneNode ( void )
     82  {
     83    sceneNode_->detachObject(particleSystem_);
     84    sceneNode_ = NULL;
     85  }
    8686
    87         Real ParticleInterface::getVelocity()
    88         {
    89                 return velocity_;
    90         }
     87  Real ParticleInterface::getVelocity()
     88  {
     89    return velocity_;
     90  }
    9191
    92         void ParticleInterface::setVelocity(Real v)
    93         {
    94                 velocity_ = v;
    95                 //partikel anpassen
    96                 particleSystem_->setSpeedFactor(v);
    97         }
     92  void ParticleInterface::setVelocity(Real v)
     93  {
     94    velocity_ = v;
     95    //partikel anpassen
     96    particleSystem_->setSpeedFactor(v);
     97  }
    9898
    99         int ParticleInterface::getRate()
    100         {
    101                 return rate_;
    102         }
    103         void ParticleInterface::setRate(int r)
    104         {
    105                 rate_ = r;
    106                 //partikel anpassen
    107                 for (int i=0; i<numberOfEmitters_; i++) {
    108                         particleSystem_->getEmitter(i)->setEmissionRate(rate_);
    109                 }
    110         }
     99  int ParticleInterface::getRate()
     100  {
     101    return rate_;
     102  }
     103  void ParticleInterface::setRate(int r)
     104  {
     105    rate_ = r;
     106    //partikel anpassen
     107    for (int i=0; i<numberOfEmitters_; i++) {
     108      particleSystem_->getEmitter(i)->setEmissionRate(rate_);
     109    }
     110  }
    111111
    112         Real ParticleInterface::getDistance()
    113         {
    114                 return distance_;
    115         }
     112  Real ParticleInterface::getDistance()
     113  {
     114    return distance_;
     115  }
    116116
    117         void ParticleInterface::setDistance(Real d)
    118         {
    119                 distance_ = d;
    120                 //partikel anpassen
    121                 for (int i=0; i<numberOfEmitters_; i++) {
    122                         particleSystem_->getEmitter(i)->setTimeToLive(distance_);
    123                 }
    124         }
    125         ColourValue ParticleInterface::getColour()
    126         {
    127                 return colour_;
    128         }
     117  void ParticleInterface::setDistance(Real d)
     118  {
     119    distance_ = d;
     120    //partikel anpassen
     121    for (int i=0; i<numberOfEmitters_; i++) {
     122      particleSystem_->getEmitter(i)->setTimeToLive(distance_);
     123    }
     124  }
     125  ColourValue ParticleInterface::getColour()
     126  {
     127    return colour_;
     128  }
    129129
    130         void ParticleInterface::setColour(ColourValue colour)
    131         {
    132                 colour_ = colour;
    133                 //partikel anpassen
    134                 for (int i=0; i<numberOfEmitters_; i++) {
    135                         particleSystem_->getEmitter(i)->setColour(colour_);
    136                 }
    137         }
     130  void ParticleInterface::setColour(ColourValue colour)
     131  {
     132    colour_ = colour;
     133    //partikel anpassen
     134    for (int i=0; i<numberOfEmitters_; i++) {
     135      particleSystem_->getEmitter(i)->setColour(colour_);
     136    }
     137  }
    138138
    139         ParticleEmitter* ParticleInterface::getEmitter( int emitterNr )
    140         {
    141                 if (!(emitterNr<numberOfEmitters_)) return NULL;
    142                 return particleSystem_->getEmitter(emitterNr);
    143         }
     139  ParticleEmitter* ParticleInterface::getEmitter( int emitterNr )
     140  {
     141    if (!(emitterNr<numberOfEmitters_)) return NULL;
     142    return particleSystem_->getEmitter(emitterNr);
     143  }
    144144
    145         void ParticleInterface::newEmitter ( void )
    146         {
    147                 particleSystem_->addEmitter(particleSystem_->getEmitter(0)->getType());
    148                 numberOfEmitters_=numberOfEmitters_+1;
    149                 particleSystem_->getEmitter(0)->copyParametersTo( particleSystem_->getEmitter(numberOfEmitters_-1) );
    150         }
     145  void ParticleInterface::newEmitter ( void )
     146  {
     147    particleSystem_->addEmitter(particleSystem_->getEmitter(0)->getType());
     148    numberOfEmitters_=numberOfEmitters_+1;
     149    particleSystem_->getEmitter(0)->copyParametersTo( particleSystem_->getEmitter(numberOfEmitters_-1) );
     150  }
    151151
    152         void ParticleInterface::setPositionOfEmitter ( int emitterNr, Vector3 position )
    153         {
    154                 particleSystem_->getEmitter(emitterNr)->setPosition(position);
    155         }
     152  void ParticleInterface::setPositionOfEmitter ( int emitterNr, Vector3 position )
     153  {
     154    particleSystem_->getEmitter(emitterNr)->setPosition(position);
     155  }
    156156
    157         Vector3 ParticleInterface::getPositionOfEmitter ( int emitterNr )
    158         {
    159                 return particleSystem_->getEmitter(0)->getPosition();
    160         }
     157  Vector3 ParticleInterface::getPositionOfEmitter ( int emitterNr )
     158  {
     159    return particleSystem_->getEmitter(0)->getPosition();
     160  }
    161161
    162         void ParticleInterface::setDirection ( Vector3 direction )
    163         {
    164                 for(int i=0; i<numberOfEmitters_; i++) {
    165                         particleSystem_->getEmitter(i)->setDirection(direction);
    166                 }
    167         }
     162  void ParticleInterface::setDirection ( Vector3 direction )
     163  {
     164    for(int i=0; i<numberOfEmitters_; i++) {
     165      particleSystem_->getEmitter(i)->setDirection(direction);
     166    }
     167  }
    168168
    169169
    170         Vector3 ParticleInterface::getDirection ( void )
    171         {
    172                 return particleSystem_->getEmitter(0)->getDirection();
    173         }
     170  Vector3 ParticleInterface::getDirection ( void )
     171  {
     172    return particleSystem_->getEmitter(0)->getDirection();
     173  }
    174174
    175         void ParticleInterface::switchEnable(){
    176                 bool enable=(!(particleSystem_->getEmitter(0)->getEnabled()));
    177                 for(int i=0; i<numberOfEmitters_; i++) {
    178                         particleSystem_->getEmitter(i)->setEnabled(enable);
    179                 }
    180         }
     175  void ParticleInterface::switchEnable(){
     176    bool enable=(!(particleSystem_->getEmitter(0)->getEnabled()));
     177    for(int i=0; i<numberOfEmitters_; i++) {
     178      particleSystem_->getEmitter(i)->setEnabled(enable);
     179    }
     180  }
    181181
    182182}
  • code/branches/FICN/src/orxonox/run_manager.cc

    r588 r592  
    9494
    9595  /**
    96   * @param ogre_ The OgreControl object holding the render window and the Root
     96  * @param *ogre The OgreControl object holding the render window and the Root
    9797  */
    9898  void RunManager::initialise(OgreControl *ogre)
Note: See TracChangeset for help on using the changeset viewer.