Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5826 in orxonox.OLD for trunk


Ignore:
Timestamp:
Nov 29, 2005, 11:52:31 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: bomb detonation

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/network/Makefile.in

    r5822 r5826  
    214214          esac; \
    215215        done; \
    216         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/network/Makefile'; \
     216        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/network/Makefile'; \
    217217        cd $(top_srcdir) && \
    218           $(AUTOMAKE) --gnu  src/lib/network/Makefile
     218          $(AUTOMAKE) --foreign  src/lib/network/Makefile
    219219.PRECIOUS: Makefile
    220220Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • trunk/src/subprojects/network/Makefile.in

    r5822 r5826  
    217217          esac; \
    218218        done; \
    219         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/subprojects/network/Makefile'; \
     219        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/subprojects/network/Makefile'; \
    220220        cd $(top_srcdir) && \
    221           $(AUTOMAKE) --gnu  src/subprojects/network/Makefile
     221          $(AUTOMAKE) --foreign  src/subprojects/network/Makefile
    222222.PRECIOUS: Makefile
    223223Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • trunk/src/util/object_manager.cc

    r5795 r5826  
    6363    for (node = objectList->begin(); node != objectList->end(); node++)
    6464    {
    65       printf("1:::%s\n", (*node)->getName());
    6665      if ((dynamic_cast<PNode*>(*node)->getAbsCoor() - center.getAbsCoor()).len() < radius)
    67       {
    6866        newList->push_back(dynamic_cast<WorldEntity*>(*node));
    69         printf("%s\n",(*node)->getName());
    70       }
    7167    }
    7268    return newList;
  • trunk/src/world_entities/weapons/bomb.cc

    r5769 r5826  
    1717#include "glincl.h"
    1818#include "state.h"
     19#include "model.h"
     20#include "fast_factory.h"
    1921#include "list.h"
    20 #include "model.h"
    21 #include "vector.h"
    22 #include "fast_factory.h"
    2322
     23#include "object_manager.h"
    2424
    2525#include "particle_engine.h"
     
    114114      this->deactivate();
    115115    }
     116    if (this->lifeCycle > 0.9f)
     117      this->detonate ((this->lifeCycle-.89) *10000.0);
    116118}
    117119
     
    145147void Bomb::collidesWith (WorldEntity* entity, const Vector& location)
    146148{
    147         this->detonate();
     149  if (entity->isA(CL_NPC))
     150    this->lifeSpan = 0.9f;
    148151}
    149152
     
    160163}
    161164
    162 void Bomb::detonate()
     165void Bomb::detonate(float size)
    163166{
    164   tIterator<WorldEntity>* it = State::getWorldEntityList()->getIterator();
    165   WorldEntity* lm = it->firstElement();
    166 
    167   while(lm != NULL)
     167  std::list<WorldEntity*>* detonationList = ObjectManager::distanceFromObject(*this, size, CL_NPC);
     168  if (detonationList != NULL)
    168169  {
    169 
    170     lm = it->nextElement();
     170    while( !detonationList->empty() )
     171    {
     172    //detonationList->front()->collidesWith(this, Vector(0,0,0));
     173      detonationList->pop_front();
     174    }
     175    delete detonationList;
    171176  }
    172177}
  • trunk/src/world_entities/weapons/bomb.h

    r5750 r5826  
    3131  virtual void collidesWith (WorldEntity* entity, const Vector& location);
    3232  virtual void activate();
    33   virtual void detonate();
    3433  virtual void deactivate();
     34
     35  void detonate(float size);
    3536
    3637 private:
Note: See TracChangeset for help on using the changeset viewer.