Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 9, 2015, 4:03:59 PM (9 years ago)
Author:
maxima
Message:

Merged presentation and exlposionChunks branches. Works fine. Added explosion parts to hovership.

Location:
code/branches/presentationHS15
Files:
2 deleted
12 edited
2 copied

Legend:

Unmodified
Added
Removed
  • code/branches/presentationHS15

  • code/branches/presentationHS15/src/libraries/tools/ParticleInterface.cc

    r10624 r10962  
    233233            this->particleSystem_->setKeepParticlesInLocalSpace(keep);
    234234    }
     235
     236    void ParticleInterface::setDimensions(float scale)
     237    {
     238        this->particleSystem_->setDefaultDimensions(scale * this->particleSystem_->getDefaultWidth(), scale * this->particleSystem_->getDefaultHeight());
     239    }
    235240}
  • code/branches/presentationHS15/src/libraries/tools/ParticleInterface.h

    r10624 r10962  
    7575            void setDetailLevel(unsigned int level);
    7676
     77            void setDimensions(float scale);
     78
    7779        protected:
    7880            virtual void changedTimeFactor(float factor_new, float factor_old);
  • code/branches/presentationHS15/src/modules/dodgerace/DodgeRace.cc

    r10624 r10962  
    7171            for (int i = 0; i < 7; i++)
    7272            {
    73                 BigExplosion* chunk = new BigExplosion(this->center_->getContext());
    74                 chunk->setPosition(Vector3(600, 0, 100.f * i - 300));
    75                 chunk->setVelocity(Vector3(1000, 0, 0));  //player->getVelocity()
    76                 chunk->setScale(20);
     73                WeakPtr<ExplosionPart> chunk5 = new ExplosionPart(this->center_->getContext());
     74                chunk5->setPosition(Vector3(600, 0, 100.f * i - 300));
     75                chunk5->setVelocity(Vector3(1000, 0, 0));  //player->getVelocity()
     76                chunk5->setScale(10);
     77                chunk5->setEffect1("Orxonox/explosion2b");
     78                chunk5->setEffect2("Orxonox/smoke6");
     79                chunk5->Explode();
     80
    7781            }
    7882        }
  • code/branches/presentationHS15/src/modules/dodgerace/DodgeRace.h

    r10624 r10962  
    5656
    5757#include "core/command/ConsoleCommand.h"
    58 #include "worldentities/BigExplosion.h"
    5958
    6059#include "gametypes/Deathmatch.h"
  • code/branches/presentationHS15/src/modules/invader/Invader.cc

    r10624 r10962  
    5151
    5252#include "core/command/ConsoleCommand.h"
    53 #include "worldentities/BigExplosion.h"
     53#include "worldentities/ExplosionPart.h"
    5454
    5555namespace orxonox
     
    8282            for (int i = 0; i < 7; i++)
    8383            {
    84                 BigExplosion* chunk = new BigExplosion(this->center_->getContext());
    85                 chunk->setPosition(Vector3(600, 0, 100.f * i - 300));
    86                 chunk->setVelocity(Vector3(1000, 0, 0));  //player->getVelocity()
    87                 chunk->setScale(20);
     84
     85                WeakPtr<ExplosionPart> chunk5 = new ExplosionPart(this->center_->getContext());
     86                chunk5->setPosition(this->center_->getPosition());
     87                chunk5->setVelocity(Vector3(1000, 0, 0));  //player->getVelocity()
     88                chunk5->setScale(10);
     89                chunk5->setEffect1("Orxonox/explosion2b");
     90                chunk5->setEffect2("Orxonox/smoke6");
     91                chunk5->setMinSpeed(0);
     92                chunk5->setMaxSpeed(0);
     93                chunk5->Explode();
     94
    8895            }
    8996        }
  • code/branches/presentationHS15/src/orxonox/OrxonoxPrereqs.h

    r10961 r10962  
    176176
    177177    // worldentities
    178     class BigExplosion;
    179178    class CameraPosition;
    180179    class ControllableEntity;
  • code/branches/presentationHS15/src/orxonox/items/ShipPart.cc

    r10624 r10962  
    4141#include "worldentities/StaticEntity.h"
    4242#include "items/PartDestructionEvent.h"
    43 #include "worldentities/BigExplosion.h"
    4443#include "chat/ChatManager.h"
    4544
     
    105104    void ShipPart::explode()
    106105    {
    107         BigExplosion* chunk = new BigExplosion(this->getContext());
    108         chunk->setPosition(this->parent_->getPosition() + this->parent_->getOrientation() * (this->explosionPosition_));
    109         //chunk->setPosition(this->parent_->getPosition() + this->parent_->getOrientation() * Vector3(this->entityList_[0]->getLocalInertia()));
    110         chunk->setVelocity(this->parent_->getVelocity());
     106        // BigExplosion* chunk = new BigExplosion(this->getContext());
     107        // chunk->setPosition(this->parent_->getPosition() + this->parent_->getOrientation() * (this->explosionPosition_));
     108        // //chunk->setPosition(this->parent_->getPosition() + this->parent_->getOrientation() * Vector3(this->entityList_[0]->getLocalInertia()));
     109        // chunk->setVelocity(this->parent_->getVelocity());
    111110
    112111        // this->explosionSound_->setPosition(this->parent_->getPosition());
  • code/branches/presentationHS15/src/orxonox/worldentities/CMakeLists.txt

    r8706 r10962  
    66  ControllableEntity.cc
    77  Drone.cc
    8   BigExplosion.cc
    98  EffectContainer.cc
    109  ExplosionChunk.cc
     
    1211  SpawnPoint.cc
    1312  TeamSpawnPoint.cc
     13  ExplosionPart.cc
    1414)
    1515
  • code/branches/presentationHS15/src/orxonox/worldentities/pawns/Pawn.cc

    r10961 r10962  
    4141#include "graphics/ParticleSpawner.h"
    4242#include "worldentities/ExplosionChunk.h"
    43 #include "worldentities/BigExplosion.h"
     43#include "worldentities/ExplosionPart.h"
    4444#include "weaponsystem/WeaponSystem.h"
    4545#include "weaponsystem/WeaponSlot.h"
     
    8484        this->aimPosition_ = Vector3::ZERO;
    8585
     86        //this->explosionPartList_ = NULL;
     87
    8688        if (GameMode::isMaster())
    8789        {
     
    136138        XMLPortParam(Pawn, "spawnparticlesource", setSpawnParticleSource, getSpawnParticleSource, xmlelement, mode);
    137139        XMLPortParam(Pawn, "spawnparticleduration", setSpawnParticleDuration, getSpawnParticleDuration, xmlelement, mode).defaultValues(3.0f);
    138         XMLPortParam(Pawn, "explosionchunks", setExplosionChunks, getExplosionChunks, xmlelement, mode).defaultValues(7);
     140        XMLPortParam(Pawn, "explosionchunks", setExplosionChunks, getExplosionChunks, xmlelement, mode).defaultValues(0);
    139141
    140142        XMLPortObject(Pawn, WeaponSlot, "weaponslots", addWeaponSlot, getWeaponSlot, xmlelement, mode);
     
    145147        XMLPortParam(Pawn, "shieldrechargerate", setShieldRechargeRate, getShieldRechargeRate, xmlelement, mode).defaultValues(0);
    146148        XMLPortParam(Pawn, "shieldrechargewaittime", setShieldRechargeWaitTime, getShieldRechargeWaitTime, xmlelement, mode).defaultValues(1.0f);
     149        XMLPortObject(Pawn, ExplosionPart, "explosion", addExplosionPart, getExplosionPart, xmlelement, mode);
    147150
    148151        XMLPortParam(Pawn, "explosionSound",  setExplosionSound,  getExplosionSound,  xmlelement, mode);
     
    164167    void Pawn::tick(float dt)
    165168    {
     169        //BigExplosion* chunk = new BigExplosion(this->getContext());
    166170        SUPER(Pawn, tick, dt);
    167171
     
    368372            if (GameMode::isMaster())
    369373            {
    370                 this->deatheffect();
    371374                this->goWithStyle();
    372375            }
     
    375378    void Pawn::goWithStyle()
    376379    {
     380
    377381        this->bAlive_ = false;
    378382        this->setDestroyWhenPlayerLeft(false);
    379383
    380         BigExplosion* chunk = new BigExplosion(this->getContext());
    381         chunk->setPosition(this->getPosition());
    382         chunk->setVelocity(this->getVelocity());
     384        while(!explosionPartList_.empty())
     385        {
     386            explosionPartList_.back()->setPosition(this->getPosition());
     387            explosionPartList_.back()->setVelocity(this->getVelocity());
     388            explosionPartList_.back()->setOrientation(this->getOrientation());
     389            explosionPartList_.back()->Explode();
     390            explosionPartList_.pop_back();
     391        }
     392
     393        for (unsigned int i = 0; i < this->numexplosionchunks_; ++i)
     394        {
     395            ExplosionChunk* chunk = new ExplosionChunk(this->getContext());
     396            chunk->setPosition(this->getPosition());
     397        }
    383398
    384399        this->explosionSound_->setPosition(this->getPosition());
    385400        this->explosionSound_->play();
    386     }
    387     void Pawn::deatheffect()
    388     {
    389         // play death effect
    390         /*{
    391             ParticleSpawner* effect = new ParticleSpawner(this->getContext());
    392             effect->setPosition(this->getPosition());
    393             effect->setOrientation(this->getOrientation());
    394             effect->setDestroyAfterLife(true);
    395             effect->setSource("Orxonox/explosion2b");
    396             effect->setLifetime(4.0f);
    397         }
    398         {
    399             ParticleSpawner* effect = new ParticleSpawner(this->getContext());
    400             effect->setPosition(this->getPosition());
    401             effect->setOrientation(this->getOrientation());
    402             effect->setDestroyAfterLife(true);
    403             effect->setSource("Orxonox/smoke6");
    404             effect->setLifetime(4.0f);
    405         }
    406         {
    407             ParticleSpawner* effect = new ParticleSpawner(this->getContext());
    408             effect->setPosition(this->getPosition());
    409             effect->setOrientation(this->getOrientation());
    410             effect->setDestroyAfterLife(true);
    411             effect->setSource("Orxonox/sparks");
    412             effect->setLifetime(4.0f);
    413         }*/
    414        
    415        
    416         {
    417             ParticleSpawner* effect = new ParticleSpawner(this->getContext());
    418             effect->setPosition(this->getPosition());
    419             effect->setOrientation(this->getOrientation());
    420             effect->setDestroyAfterLife(true);
    421             effect->setSource("orxonox/explosion_flash2");
    422             effect->setLifetime(5.0f);
    423         }
    424         {
    425             ParticleSpawner* effect = new ParticleSpawner(this->getContext());
    426             effect->setPosition(this->getPosition());
    427             effect->setOrientation(this->getOrientation());
    428             effect->setDestroyAfterLife(true);
    429             effect->setSource("orxonox/explosion_flame2");
    430             effect->setLifetime(5.0f);
    431         }
    432         {
    433             ParticleSpawner* effect = new ParticleSpawner(this->getContext());
    434             effect->setPosition(this->getPosition());
    435             effect->setOrientation(this->getOrientation());
    436             effect->setDestroyAfterLife(true);
    437             effect->setSource("orxonox/explosion_shockwave2");
    438             effect->scale(20);
    439             effect->setLifetime(5.0f);
    440         }{
    441             ParticleSpawner* effect = new ParticleSpawner(this->getContext());
    442             effect->setPosition(this->getPosition());
    443             effect->setOrientation(this->getOrientation());
    444             effect->setDestroyAfterLife(true);
    445             effect->setSource("orxonox/explosion_sparks2");
    446             effect->setLifetime(5.0f);
    447         }
    448         {
    449             ParticleSpawner* effect = new ParticleSpawner(this->getContext());
    450             effect->setPosition(this->getPosition());
    451             effect->setOrientation(this->getOrientation());
    452             effect->setDestroyAfterLife(true);
    453             effect->setSource("orxonox/explosion_streak2");
    454             effect->setLifetime(5.0f);
    455         }
    456         {
    457             ParticleSpawner* effect = new ParticleSpawner(this->getContext());
    458             effect->setPosition(this->getPosition());
    459             effect->setOrientation(this->getOrientation());
    460             effect->setDestroyAfterLife(true);
    461             effect->setSource("orxonox/explosion_afterglow");
    462             effect->scale(20);
    463             effect->setLifetime(5.0f);
    464         }
    465        
    466        
    467         for (unsigned int i = 0; i < this->numexplosionchunks_; ++i)
    468         {
    469             ExplosionChunk* chunk = new ExplosionChunk(this->getContext());
    470             chunk->setPosition(this->getPosition());
    471         }
    472401    }
    473402
     
    476405        Check whether the Pawn has a @ref Orxonox::WeaponSystem and fire it with the specified firemode if it has one.
    477406    */
     407
    478408    void Pawn::fired(unsigned int firemode)
    479409    {
     
    488418            this->spawneffect();
    489419    }
     420
     421
     422    void Pawn::addExplosionPart(ExplosionPart* ePart)
     423    {this->explosionPartList_.push_back(ePart);}
     424
     425
     426    ExplosionPart * Pawn::getExplosionPart()
     427    {return this->explosionPartList_.back();}
     428
     429
    490430
    491431    /* WeaponSystem:
  • code/branches/presentationHS15/src/orxonox/worldentities/pawns/Pawn.h

    r10961 r10962  
    3333
    3434#include <string>
     35#include <vector>
    3536#include "interfaces/PickupCarrier.h"
    3637#include "interfaces/RadarViewable.h"
    3738#include "worldentities/ControllableEntity.h"
     39#include "worldentities/ExplosionPart.h"
    3840
    3941
     
    142144            virtual void fired(unsigned int firemode);
    143145            virtual void postSpawn();
     146
     147            void addExplosionPart(ExplosionPart* ePart);
     148            ExplosionPart * getExplosionPart();
    144149
    145150            void addWeaponSlot(WeaponSlot * wSlot);
     
    206211            virtual Controller* getSlave();
    207212            virtual void goWithStyle();
    208             virtual void deatheffect();
    209213            virtual void spawneffect();
    210214
     
    241245            unsigned int numexplosionchunks_;
    242246
     247            std::vector<ExplosionPart*> explosionPartList_;
     248
    243249        private:
    244250            void registerVariables();
  • code/branches/presentationHS15/src/orxonox/worldentities/pawns/SpaceShip.cc

    r10961 r10962  
    115115
    116116        XMLPortObject(SpaceShip, Engine, "engines", addEngine, getEngine, xmlelement, mode);
     117
     118       
    117119    }
    118120
Note: See TracChangeset for help on using the changeset viewer.