Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 2, 2015, 3:23:03 PM (8 years ago)
Author:
vaydin
Message:

Deleted previously created VaydinExplosion class, created ExplosionPart class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/explosionChunksHS15/src/orxonox/worldentities/pawns/Pawn.cc

    r10669 r10752  
    4242#include "worldentities/ExplosionChunk.h"
    4343#include "worldentities/BigExplosion.h"
    44 //#include "worldentities/VaydinExplosion.h"
     44#include "worldentities/ExplosionPart.h"
    4545#include "weaponsystem/WeaponSystem.h"
    4646#include "weaponsystem/WeaponSlot.h"
     
    8686        this->aimPosition_ = Vector3::ZERO;
    8787
     88        //this->explosionPartList_ = NULL;
     89
    8890        if (GameMode::isMaster())
    8991        {
     
    144146        XMLPortObject(Pawn, WeaponPack, "weapons", addWeaponPackXML, getWeaponPack, xmlelement, mode);
    145147
    146         //XMLPortObject(Pawn, VaydinExplosion, "vaydinexplosion", addVaydinExplosion, getVaydinExplosion, xmlelement, mode);
     148        XMLPortObject(Pawn, ExplosionPart, "explosion", addExplosionPart, getExplosionPart, xmlelement, mode);
    147149
    148150        XMLPortParam(Pawn, "reloadrate", setReloadRate, getReloadRate, xmlelement, mode).defaultValues(0);
     
    385387        this->setDestroyWhenPlayerLeft(false);
    386388
    387         BigExplosion* chunk = new BigExplosion(this->getContext());
     389        /*ExplosionPart* chunk = new ExplosionPart(this->getContext());
    388390        chunk->setPosition(this->getPosition());
    389391        chunk->setVelocity(this->getVelocity());
     392        chunk->Explode();*/
     393
     394        while(!explosionPartList_.empty())
     395        {
     396            explosionPartList_.back()->setPosition(this->getPosition());
     397            explosionPartList_.back()->setVelocity(this->getVelocity());
     398            explosionPartList_.back()->Explode();
     399            explosionPartList_.pop_back();
     400        }
    390401
    391402        this->explosionSound_->setPosition(this->getPosition());
     
    497508            this->spawneffect();
    498509    }
     510
     511
     512    void Pawn::addExplosionPart(ExplosionPart* ePart)
     513    {this->explosionPartList_.push_back(ePart);}
     514
     515
     516    ExplosionPart * Pawn::getExplosionPart()
     517    {return this->explosionPartList_.back();}
     518
     519
    499520
    500521    /* WeaponSystem:
Note: See TracChangeset for help on using the changeset viewer.