Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10810


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

added offset option for explosion

Location:
code/branches/explosionChunksHS15
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/explosionChunksHS15/data/levels/emptyLevel.oxw

    r10807 r10810  
    3737        <templates>
    3838          <Template link=spaceshipassff />
    39         </templates>
    40 
    41         <explosion >
    42           <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
    43           <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
    44           <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
    45         </explosion>
    46          
    47                    
     39        </templates>         
    4840    </SpaceShip>
    4941    <SpaceShip
     
    5446          <Template link=spaceshipassff />
    5547        </templates>
    56 
    57         <explosion >
    58           <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
    59           <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
    60           <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
    61 
    62           <ExplosionPart minspeed=0 maxspeed=0 effect1="Orxonox/explosion2b" effect2="Orxonox/smoke6" />
    63           <ExplosionPart mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
    64           <ExplosionPart mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
    65           <ExplosionPart mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
    66           <ExplosionPart mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
    67         </explosion>
    6848                   
    6949    </SpaceShip>
     
    7353        >
    7454        <templates>
    75           <Template link=spaceshipassff />
     55          <Template link=spaceshipescort />
    7656        </templates>
    77 
    78         <explosion>
    79           <ExplosionPart mesh="WingDebris1.mesh" />
    80           <ExplosionPart mesh="WingDebris2.mesh" />
    81          
    82         </explosion>
    8357
    8458       
  • code/branches/explosionChunksHS15/data/levels/templates/spaceshipAssff.oxt

    r10807 r10810  
    5757    </collisionShapes>
    5858    <explosion >
    59       <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
    60       <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
    61       <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
     59      <ExplosionPart offset="100,100,100" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
     60      <ExplosionPart offset="100,100,100" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
     61      <ExplosionPart offset="100,100,100" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
    6262
    63       <ExplosionPart minspeed=0 maxspeed=0 effect1="Orxonox/explosion2b" effect2="Orxonox/smoke6" />
    64       <ExplosionPart mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
    65       <ExplosionPart mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
    66       <ExplosionPart mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
    67       <ExplosionPart mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
     63      <ExplosionPart offset="100,100,100" minspeed=0 maxspeed=0 effect1="Orxonox/explosion2b" effect2="Orxonox/smoke6" />
     64      <ExplosionPart offset="100,100,100" mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
     65      <ExplosionPart offset="100,100,100" mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
     66      <ExplosionPart offset="100,100,100" mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
     67      <ExplosionPart offset="100,100,100" mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
    6868    </explosion>
    6969<?lua
  • 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
  • code/branches/explosionChunksHS15/src/orxonox/worldentities/ExplosionPart.h

    r10786 r10810  
    6565            void setMaxSpeed(float speed);
    6666            float getMaxSpeed();
     67            void setOffset(Vector3 newVector);
     68            Vector3 getOffset();
    6769         
    6870
     
    8385                std::string effect1_;
    8486            std::string effect2_;
     87            Vector3 posOffset_;
    8588
    8689            MovableEntity* explosionEntity_;
  • code/branches/explosionChunksHS15/src/orxonox/worldentities/pawns/Pawn.cc

    r10807 r10810  
    140140        XMLPortParam(Pawn, "spawnparticlesource", setSpawnParticleSource, getSpawnParticleSource, xmlelement, mode);
    141141        XMLPortParam(Pawn, "spawnparticleduration", setSpawnParticleDuration, getSpawnParticleDuration, xmlelement, mode).defaultValues(3.0f);
    142         XMLPortParam(Pawn, "explosionchunks", setExplosionChunks, getExplosionChunks, xmlelement, mode).defaultValues(7);
     142        XMLPortParam(Pawn, "explosionchunks", setExplosionChunks, getExplosionChunks, xmlelement, mode).defaultValues(0);
    143143
    144144        XMLPortObject(Pawn, WeaponSlot, "weaponslots", addWeaponSlot, getWeaponSlot, xmlelement, mode);
Note: See TracChangeset for help on using the changeset viewer.