Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6142 in orxonox.OLD for trunk/src/world_entities/weapons


Ignore:
Timestamp:
Dec 16, 2005, 7:13:57 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merge the ObjectManager to the trunk
merged with command:
svn merge -r6082:HEAD objectmanager/ ../trunk/

conflicts resolution was easy this time :)
but specially merged the world to network_world

Location:
trunk/src/world_entities/weapons
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/weapons/aim.cc

    r6078 r6142  
    104104void Aim::searchTarget(float range)
    105105{
    106   tIterator<WorldEntity>* iterator = State::getWorldEntityList()->getIterator();
     106  //FIXME//
     107/*  tIterator<WorldEntity>* iterator = State::getWorldEntityList()->getIterator();
    107108  WorldEntity* entity = iterator->firstElement();
    108109  while (likely(entity != NULL))
     
    121122  }
    122123
    123   delete iterator;
     124  delete iterator;*/
    124125}
    125126
  • trunk/src/world_entities/weapons/bomb.cc

    r5994 r6142  
    174174void Bomb::activate()
    175175{
    176   State::getWorldEntityList()->add(this);
    177176
    178177}
     
    180179void Bomb::deactivate()
    181180{
    182   State::getWorldEntityList()->remove(this);
     181  this->toList(OM_DEAD);
    183182  this->lifeCycle = 0.0f;
    184183  Bomb::fastFactory->kill(this);
  • trunk/src/world_entities/weapons/ground_turret.cc

    r5994 r6142  
    8989  {
    9090    this->left->setParent(this);
     91    this->left->toList(this->getOMListNumber());
    9192    this->left->setRelCoor(0,10,-5);
    9293  }
     
    9899  {
    99100    this->right->setParent(this);
     101    this->right->toList(this->getOMListNumber());
    100102    this->right->setRelCoor(0,10,5);
    101103  }
  • trunk/src/world_entities/weapons/guided_missile.cc

    r6078 r6142  
    8585void GuidedMissile::activate()
    8686{
    87   State::getWorldEntityList()->add(this);
    8887  if (unlikely(GuidedMissile::trailParticles == NULL))
    8988  {
     
    129128  this->lifeCycle = 0.0;
    130129
    131 //  GarbageCollector::getInstance()->collect(this);
    132   State::getWorldEntityList()->remove(this);
     130  this->toList(OM_DEAD);
    133131  this->removeNode();
    134132  GuidedMissile::fastFactory->kill(this);
     
    152150  if (this->target != NULL && this->target->getParent() != PNode::getNullParent())
    153151   {
    154      printf("========%s::%s\n", target->getParent()->getClassName(), target->getParent()->getName() );
    155152     velocity += ((target->getAbsCoor() - this->getAbsCoor()).getNormalized())*agility;
    156153     float speed = velocity.len();
  • trunk/src/world_entities/weapons/laser.cc

    r6056 r6142  
    7777void Laser::activate()
    7878{
    79   State::getWorldEntityList()->add(this);
    8079  if (unlikely(Laser::explosionParticles == NULL))
    8180  {
     
    9897  this->lifeCycle = 0.0;
    9998
    100 //  GarbageCollector::getInstance()->collect(this);
    101   State::getWorldEntityList()->remove(this);
     99  this->toList(OM_NULL);
    102100  this->removeNode();
    103101  Laser::fastFactory->kill(this);
     
    134132  this->lifeCycle = .95; //!< @todo calculate this usefully.
    135133  ParticleEngine::getInstance()->addConnection(this->emitter, Laser::explosionParticles);
    136 
    137134}
    138135
  • trunk/src/world_entities/weapons/projectile.cc

    r6078 r6142  
    2222#include "weapon.h"
    2323#include "model.h"
    24 
    25 #include "garbage_collector.h"
    2624
    2725using namespace std;
  • trunk/src/world_entities/weapons/rocket.cc

    r6056 r6142  
    8282void Rocket::activate()
    8383{
    84   State::getWorldEntityList()->add(this);
    8584  if (unlikely(Rocket::trailParticles == NULL))
    8685  {
     
    125124  ParticleEngine::getInstance()->breakConnections(this->emitter);
    126125  this->lifeCycle = 0.0;
     126  this->toList(OM_NULL);
    127127
    128128//  GarbageCollector::getInstance()->collect(this);
    129   State::getWorldEntityList()->remove(this);
     129  this->toList(OM_DEAD);
    130130  Rocket::fastFactory->kill(this);
    131131}
  • trunk/src/world_entities/weapons/test_bullet.cc

    r5994 r6142  
    8282void TestBullet::activate()
    8383{
    84   State::getWorldEntityList()->add(this);
    8584  if (unlikely(TestBullet::trailParticles == NULL))
    8685  {
     
    119118  ParticleEngine::getInstance()->breakConnections(this->emitter);
    120119  this->lifeCycle = 0.0;
     120  this->toList(OM_NULL);
    121121
    122 //  GarbageCollector::getInstance()->collect(this);
    123   State::getWorldEntityList()->remove(this);
    124122  TestBullet::fastFactory->kill(this);
    125123}
  • trunk/src/world_entities/weapons/weapon.cc

    r6054 r6142  
    192192{
    193193  if (likely (this->projectileFactory != NULL))
    194     return dynamic_cast<Projectile*>(this->projectileFactory->resurrect());
     194  {
     195    Projectile* pj = dynamic_cast<Projectile*>(this->projectileFactory->resurrect());
     196    pj->toList((OM_LIST)(this->getOMListNumber()+1));
     197    return pj;
     198  }
    195199  else
    196200  {
  • trunk/src/world_entities/weapons/weapon_manager.cc

    r6074 r6142  
    3535 * @param number of weapon slots of the model/ship <= 8 (limitied)
    3636 */
    37 WeaponManager::WeaponManager(PNode* parent)
     37WeaponManager::WeaponManager(WorldEntity* parent)
    3838{
    3939  this->init();
     
    155155 * a PNode.
    156156 */
    157 void WeaponManager::setParent(PNode* parent)
    158 {
    159   if (parent == NULL)
    160     parent = PNode::getNullParent();
     157void WeaponManager::setParent(WorldEntity* parent)
     158{
    161159  this->parent = parent;
    162160  if (this->parent != NULL)
     
    247245  this->configs[configID][slotID] = weapon;
    248246  if (this->parent != NULL)
    249     weapon->setParent(parent);
     247  {
     248    this->parent->addChild(weapon);
     249  }
    250250  PRINTF(3)("Added a new Weapon to the WeaponManager: config %i/ slot %i\n", configID, slotID);
    251251}
     
    373373      else
    374374      {
     375        if (this->currentSlotConfig[i].currentWeapon != NULL)
     376          this->currentSlotConfig[i].currentWeapon->toList(OM_NULL);
    375377        tickWeapon = this->currentSlotConfig[i].currentWeapon = this->currentSlotConfig[i].nextWeapon;
    376378        if (tickWeapon != NULL)
     
    378380          tickWeapon->requestAction(WA_ACTIVATE);
    379381          tickWeapon->setParent(&this->currentSlotConfig[i].position);
     382          tickWeapon->toList(this->parent->getOMListNumber());
    380383          this->currentSlotConfig[i].position.activateNode();
    381384        }
  • trunk/src/world_entities/weapons/weapon_manager.h

    r6055 r6142  
    4545
    4646  public:
    47     WeaponManager(PNode* parent);
     47    WeaponManager(WorldEntity* parent);
    4848    WeaponManager(const TiXmlElement* root);
    4949    ~WeaponManager();
     
    6363    long getSlotCapability(int slot) const { return this->currentSlotConfig[slot].capability; };
    6464
    65     void setParent(PNode* parent);
     65    void setParent(WorldEntity* parent);
    6666    /** @returns the Parent (carrier) of this WeaponManager */
    6767    PNode* getParent() const { return this->parent; };
     
    9393
    9494  private:
    95     PNode*                  parent;                                   //!< The parent, this WeaponManager is connected to.
     95    WorldEntity*            parent;                                   //!< The parent, this WeaponManager is connected to.
    9696
    9797    int                     slotCount;                                //!< number of weapon slots the ship has.
Note: See TracChangeset for help on using the changeset viewer.