Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 16, 2015, 3:51:56 PM (8 years ago)
Author:
vaydin
Message:

added offset option for explosion

File:
1 edited

Legend:

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

    r10807 r10810  
    4949                this->effect2Particle_= NULL;
    5050                this->explosionEntity_ = new MovableEntity(this->getContext());
     51                this->posOffset_ = Vector3::ZERO;
    5152
    5253
     
    8283                XMLPortParam(ExplosionPart, "effect1", setEffect1, getEffect1, xmlelement, mode).defaultValues("");
    8384                XMLPortParam(ExplosionPart, "effect2", setEffect2, getEffect2, xmlelement, mode).defaultValues("");
     85                XMLPortParam(ExplosionPart, "offset", setOffset, getOffset, xmlelement, mode).defaultValues(Vector3::ZERO);
    8486
    8587
     
    9092        {
    9193                orxout() << "Explode" << endl;
     94
    9295
    9396
     
    174177        }
    175178
     179        void ExplosionPart::setOffset(Vector3 newVector)
     180        {
     181                this->posOffset_ = newVector;
     182                this->setPosition(this->getPosition() + this->posOffset_);
     183        }
     184
    176185        std::string& ExplosionPart::getMesh()
    177186        { return this->mesh_; }
     
    193202        }
    194203
     204        Vector3 ExplosionPart::getOffset()
     205        {
     206                return this->posOffset_;
     207        }
     208
    195209
    196210
Note: See TracChangeset for help on using the changeset viewer.