Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10523 in orxonox.OLD


Ignore:
Timestamp:
Jan 30, 2007, 11:14:26 PM (17 years ago)
Author:
patrick
Message:

tried fixing the segfault on tardis, emitter mount point attach

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/story_entities/game_world.cc

    r10515 r10523  
    591591{
    592592  CameraMan* man = State::getCameraman();
    593   man->getCurrentCam()->apply ();
    594   man->getCurrentCam()->project ();
     593  Camera* c = man->getCurrentCam();
     594  if( c != NULL)
     595  {
     596    c->apply ();
     597    c->project ();
     598  }
    595599  GraphicsEngine::storeMatrices();
    596600}
  • trunk/src/world_entities/mount_point.cc

    r10513 r10523  
    2222
    2323#include "weapons/weapon_slot.h"
     24
     25#include "particles/particle_system.h"
    2426
    2527#include "mount_point.h"
     
    140142    PRINTF(0)("Got detail informations\n");
    141143    this->_mount->loadParams( root);
     144
     145    if( this->_mount->isA(ParticleSystem::staticClassID()))
     146    {
     147      PRINTF(0)("got particle system. attaching it to mp\n");
     148      dynamic_cast<ParticleSystem*>(this->_mount)->attachEmmittersTo(this, Vector(0,0,0));
     149    }
    142150  }
    143151}
  • trunk/src/world_entities/particles/particle_system.cc

    r10520 r10523  
    281281}
    282282
     283
     284/**
     285 * attackes
     286 * @param node
     287 */
     288void ParticleSystem::attachEmmittersTo(PNode* node, const Vector& offset)
     289{
     290  std::list<ParticleEmitter*>::iterator it = this->emitters.begin();
     291  for( ; it != this->emitters.end(); it++)
     292  {
     293    //
     294    (*it)->setParent(node);
     295    (*it)->setRelCoor(offset);
     296  }
     297}
     298
     299
     300
    283301/**
    284302 * @brief does a Precaching, meaning, that the ParticleSystem(and its emitters) will be ticked force
  • trunk/src/world_entities/particles/particle_system.h

    r9869 r10523  
    9696  void removeEmitter(ParticleEmitter* emitter);
    9797
     98  void attachEmmittersTo(PNode* node, const Vector& offset);
     99
    98100  virtual void applyField(const Field* field);
    99101  /** @brief this is an empty function, because the Physics are implemented in tick @param dt: useless here */
Note: See TracChangeset for help on using the changeset viewer.