Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 7, 2015, 3:32:07 PM (9 years ago)
Author:
vaydin
Message:

Finalized everything deleted now unnecessary BigExplosion

Location:
code/branches/explosionChunksHS15/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • code/branches/explosionChunksHS15/src/libraries/tools/ParticleInterface.cc

    r10624 r10937  
    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/explosionChunksHS15/src/libraries/tools/ParticleInterface.h

    r10624 r10937  
    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/explosionChunksHS15/src/modules/dodgerace/DodgeRace.cc

    r10624 r10937  
    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/explosionChunksHS15/src/modules/dodgerace/DodgeRace.h

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

    r10624 r10937  
    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/explosionChunksHS15/src/orxonox/OrxonoxPrereqs.h

    r10624 r10937  
    175175
    176176    // worldentities
    177     class BigExplosion;
    178177    class CameraPosition;
    179178    class ControllableEntity;
  • code/branches/explosionChunksHS15/src/orxonox/items/ShipPart.cc

    r10624 r10937  
    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/explosionChunksHS15/src/orxonox/worldentities/CMakeLists.txt

    r10752 r10937  
    66  ControllableEntity.cc
    77  Drone.cc
    8   BigExplosion.cc
    98  EffectContainer.cc
    109  ExplosionChunk.cc
  • code/branches/explosionChunksHS15/src/orxonox/worldentities/ExplosionPart.cc

    r10837 r10937  
    2626 *
    2727 */
     28
    2829
    2930
     
    8687                XMLPortParam(ExplosionPart, "direction", setDirection, getDirection, xmlelement, mode).defaultValues(Vector3(1,1,1));
    8788                XMLPortParam(ExplosionPart, "angle", setAngle, getAngle, xmlelement, mode).defaultValues(180);
    88                 XMLPortParam(ExplosionPart, "size", setSize, getSize, xmlelement, mode).defaultValues(4);
    8989                XMLPortParam(ExplosionPart, "delay", setDelay, getDelay, xmlelement, mode).defaultValues(0);
    9090        }
     
    120120                //this->model_->setSyncMode(0);
    121121
     122
    122123                if(effect1_ != "")
    123124                {
    124125                        this->effect1Particle_ = new ParticleInterface(this->getScene()->getSceneManager(), effect1_, this->LOD_);
     126                        this->effect1Particle_->setDimensions(this->getScale());
    125127                        this->model_->attachOgreObject(this->effect1Particle_->getParticleSystem());
    126128                }
     
    129131                {
    130132                        this->effect2Particle_ = new ParticleInterface(this->getScene()->getSceneManager(), effect2_, this->LOD_);
     133                        this->effect2Particle_->setDimensions(this->getScale());
    131134                        this->model_->attachOgreObject(this->effect2Particle_->getParticleSystem());
    132135                }
     136
     137
    133138
    134139               
     
    144149                this->explosionEntity_->setVelocity(finalDirection*rnd(minSpeed_,maxSpeed_));
    145150        this->explosionEntity_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
    146         this->explosionEntity_->setScale(size_);
     151        this->explosionEntity_->setScale(this->getScale() * 4);
     152
    147153
    148154        this->explosionEntity_->attach(model_);
     155
    149156
    150157        this->attach(explosionEntity_);
     
    192199        {
    193200                this->posOffset_ = newVector;
    194                 this->explosionEntity_->setPosition(this->getPosition() + this->posOffset_);
     201                this->explosionEntity_->setPosition(this->getPosition() + this->posOffset_ / this->getScale());
    195202        }
    196203
     
    203210        {
    204211                this->angle_ = newAngle;
    205         }
    206 
    207         void ExplosionPart::setSize(float newSize)
    208         {
    209                 this->size_ = newSize;
    210212        }
    211213
     
    249251        }
    250252
    251         float ExplosionPart::getSize()
    252         {
    253                 return size_;
    254         }
    255 
    256253        float ExplosionPart::getDelay()
    257254        {
  • code/branches/explosionChunksHS15/src/orxonox/worldentities/ExplosionPart.h

    r10837 r10937  
    7272            void setAngle(float newAgnle);
    7373            float getAngle();
    74             void setSize(float newSize);
    75             float getSize();
    7674            void setDelay(float newDelay);
    7775            float getDelay();
     
    9795            Vector3 direction_;
    9896            float angle_;
    99             float size_;
    10097            float delay_;
    10198
  • code/branches/explosionChunksHS15/src/orxonox/worldentities/pawns/Pawn.cc

    r10837 r10937  
    4141#include "graphics/ParticleSpawner.h"
    4242#include "worldentities/ExplosionChunk.h"
    43 #include "worldentities/BigExplosion.h"
    4443#include "worldentities/ExplosionPart.h"
    4544#include "weaponsystem/WeaponSystem.h"
     
    380379    void Pawn::goWithStyle()
    381380    {
    382         orxout() << "gowithstyle" << endl;
    383 
    384381
    385382        this->bAlive_ = false;
Note: See TracChangeset for help on using the changeset viewer.