Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10837


Ignore:
Timestamp:
Nov 23, 2015, 3:46:58 PM (9 years ago)
Author:
vaydin
Message:

fixed position offset, added definable direction for the meshes to fly in, added size, added delay

Location:
code/branches/explosionChunksHS15
Files:
8 edited

Legend:

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

    r10807 r10837  
    552552    All Pawns can easily be included into a level using the lua file "HeavyCruiserParts" -->
    553553
    554     <Pawn team=1 health=1000 initialhealth=1000 maxhealth=1000 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=10000 name=HeavyCruiser_body radarname = "HeavyCruiser" >
    555         <explosion >
    556             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
    557             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
    558             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
     554    <Pawn team=1 health=100 initialhealth=100 maxhealth=100 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=10000 name=HeavyCruiser_body radarname = "HeavyCruiser" >
     555        <explosion>
     556            <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" size=20 />
     557            <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" size=20 />
     558            <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" size=20 />
     559
     560            <ExplosionPart offset="50,50,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" size=20 delay=0.3 />
     561            <ExplosionPart offset="50,50,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" size=20 delay=0.3 />
     562            <ExplosionPart offset="50,50,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" size=20 delay=0.3 />
     563
     564            <ExplosionPart offset="100,100,100" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" size=20 delay=0.6 />
     565            <ExplosionPart offset="100,100,100" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" size=20 delay=0.6 />
     566            <ExplosionPart offset="100,100,100" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" size=20 delay=0.6 />
     567
     568            <ExplosionPart offset="150,150,150" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" size=20 delay=0.9 />
     569            <ExplosionPart offset="150,150,150" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" size=20 delay=0.9 />
     570            <ExplosionPart offset="150,150,150" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" size=20 delay=0.9 />
    559571        </explosion>
    560572        <attached>
     
    724736    <Pawn team=1 health=300 initialhealth=300 maxhealth=300 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=1000 name=HeavyCruiser_sidearmL radarname = "HIDDEN" >
    725737
    726         <explosion >
    727             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
    728             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
    729             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
     738        <explosion>
     739            <ExplosionPart offset="-140,0,115" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
     740            <ExplosionPart offset="-140,0,115" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
     741            <ExplosionPart offset="-140,0,115" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
    730742        </explosion>
    731743
     
    770782    <Pawn team=1 health=100 initialhealth=100 maxhealth=100 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=1000 name=HeavyCruiser_sidearmLfront radarname = "HIDDEN" >
    771783
    772         <explosion >
    773             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
    774             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
    775             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
     784        <explosion>
     785            <ExplosionPart offset="-141,15,-53" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
     786            <ExplosionPart offset="-141,15,-53" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
     787            <ExplosionPart offset="-141,15,-53" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
    776788        </explosion>
    777789
     
    790802
    791803    <Pawn team=1 health=300 initialhealth=300 maxhealth=300 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=1000 name=HeavyCruiser_sidearmR radarname = "HIDDEN" >
    792         <explosion >
    793             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
    794             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
    795             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
     804        <explosion>
     805            <ExplosionPart offset="140,0,115" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
     806            <ExplosionPart offset="140,0,115" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
     807            <ExplosionPart offset="140,0,115" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
    796808        </explosion>
    797809        <attached>
     
    834846
    835847    <Pawn team=1 health=100 initialhealth=100 maxhealth=100 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=1000 name=sidearmRfront radarname = "HIDDEN" >
    836         <explosion >
    837             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
    838             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
    839             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
     848        <explosion>
     849            <ExplosionPart offset="141,15,-53" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
     850            <ExplosionPart offset="141,15,-53" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
     851            <ExplosionPart offset="141,15,-53" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
    840852        </explosion>
    841853        <attached>
     
    853865
    854866    <Pawn team=1 health=100 initialhealth=100 maxhealth=100 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=1000 name=HeavyCruiser_frontL radarname = "HIDDEN" >
    855         <explosion >
    856             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
    857             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
    858             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
     867        <explosion>
     868            <ExplosionPart offset="-80,33,-320" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
     869            <ExplosionPart offset="-80,33,-320" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
     870            <ExplosionPart offset="-80,33,-320" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
    859871        </explosion>
    860872        <attached>
     
    869881
    870882    <Pawn team=1 health=100 initialhealth=100 maxhealth=100 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=1000 name=HeavyCruiser_frontR radarname = "HIDDEN" >
    871         <explosion >
    872             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
    873             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
    874             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
     883        <explosion>
     884            <ExplosionPart offset="80,33,-320" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
     885            <ExplosionPart offset="80,33,-320" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
     886            <ExplosionPart offset="80,33,-320" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
    875887        </explosion>
    876888        <attached>
     
    885897
    886898    <Pawn team=1 health=100 initialhealth=100 maxhealth=100 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=1000 name=HeavyCruiser_partL radarname = "HIDDEN" >
    887         <explosion >
    888             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
    889             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
    890             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
     899        <explosion>
     900            <ExplosionPart offset="-94,33,-179" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
     901            <ExplosionPart offset="-94,33,-179" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
     902            <ExplosionPart offset="-94,33,-179" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
    891903        </explosion>
    892904        <attached>
     
    901913
    902914    <Pawn team=1 health=100 initialhealth=100 maxhealth=100 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=1000 name=HeavyCruiser_partR radarname = "HIDDEN" >
    903         <explosion >
    904             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
    905             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
    906             <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
     915        <explosion>
     916            <ExplosionPart offset="94,33,-179" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
     917            <ExplosionPart offset="94,33,-179" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
     918            <ExplosionPart offset="94,33,-179" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
    907919        </explosion>
    908920        <attached>
  • code/branches/explosionChunksHS15/data/levels/emptyLevel.oxw

    r10810 r10837  
    1515  include("templates/spaceshipAssff.oxt")
    1616  include("templates/spaceshipEscort.oxt")
     17  include("templates/spaceshipPirate.oxt")
    1718?>
    1819
     
    4445        >
    4546        <templates>
    46           <Template link=spaceshipassff />
     47          <Template link=spaceshippirate />
    4748        </templates>
    4849                   
  • code/branches/explosionChunksHS15/data/levels/templates/spaceshipAssff.oxt

    r10810 r10837  
    5656      <BoxCollisionShape position="0,0.1,-19"  halfExtents="1.4, 1, 2" />
    5757    </collisionShapes>
    58     <explosion >
    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" />
     58    <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" />
    6262
    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" />
     63      <ExplosionPart mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" direction="0,1,0" angle=30 />
     64      <ExplosionPart mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" direction="0,1,0" angle=30 />
     65      <ExplosionPart mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" direction="0,1,0" angle=30 />
     66      <ExplosionPart mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" direction="0,1,0" angle=30 />
    6867    </explosion>
    6968<?lua
  • code/branches/explosionChunksHS15/data/levels/templates/spaceshipEscort.oxt

    r10807 r10837  
    5656      <BoxCollisionShape position="0,     0,-12" halfExtents="4  , 4 ,7" />
    5757    </collisionShapes>
    58     <explosion >
     58    <explosion>
    5959      <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
    6060      <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
    6161      <ExplosionPart 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 mesh="explosionparts/escort_part_1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
     64      <ExplosionPart mesh="explosionparts/escort_part_2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
     65      <ExplosionPart mesh="explosionparts/escort_part_3.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
     66      <ExplosionPart mesh="explosionparts/escort_part_4.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
     67      <ExplosionPart mesh="explosionparts/escort_part_5.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
     68      <ExplosionPart mesh="explosionparts/escort_part_6.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
    6869    </explosion>
    6970<?lua
  • code/branches/explosionChunksHS15/data/levels/templates/spaceshipPirate.oxt

    r10807 r10837  
    5353      <BoxCollisionShape position="0,0.1,-19"  halfExtents="1.4, 1, 2" />
    5454    </collisionShapes>
    55     <explosion >
     55    <explosion>
    5656      <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
    5757      <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
    5858      <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
    5959
    60       <ExplosionPart minspeed=0 maxspeed=0 effect1="Orxonox/explosion2b" effect2="Orxonox/smoke6" />
    61       <ExplosionPart mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
    62       <ExplosionPart mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
    63       <ExplosionPart mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
    64       <ExplosionPart mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
     60      <ExplosionPart mesh="explosionparts/pirate_part_1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
     61      <ExplosionPart mesh="explosionparts/pirate_part_2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
     62      <ExplosionPart mesh="explosionparts/pirate_part_3.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
     63      <ExplosionPart mesh="explosionparts/pirate_part_4.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
    6564    </explosion>
    6665
  • code/branches/explosionChunksHS15/src/orxonox/worldentities/ExplosionPart.cc

    r10810 r10837  
    8484                XMLPortParam(ExplosionPart, "effect2", setEffect2, getEffect2, xmlelement, mode).defaultValues("");
    8585                XMLPortParam(ExplosionPart, "offset", setOffset, getOffset, xmlelement, mode).defaultValues(Vector3::ZERO);
    86 
    87 
     86                XMLPortParam(ExplosionPart, "direction", setDirection, getDirection, xmlelement, mode).defaultValues(Vector3(1,1,1));
     87                XMLPortParam(ExplosionPart, "angle", setAngle, getAngle, xmlelement, mode).defaultValues(180);
     88                XMLPortParam(ExplosionPart, "size", setSize, getSize, xmlelement, mode).defaultValues(4);
     89                XMLPortParam(ExplosionPart, "delay", setDelay, getDelay, xmlelement, mode).defaultValues(0);
    8890        }
    8991
     
    9193        void ExplosionPart::Explode()
    9294        {
    93                 orxout() << "Explode" << endl;
    94 
    95 
    96 
    97                 this->model_->setVisible(true);
    98 
    99                 //this->explosionEntity_->setSyncMode(0);
    100 
    101                 //this->model_->setSyncMode(0);
    102 
    103                 if(effect1_ != "")
    104                 {
    105                         this->effect1Particle_ = new ParticleInterface(this->getScene()->getSceneManager(), effect1_, this->LOD_);
    106                         this->model_->attachOgreObject(this->effect1Particle_->getParticleSystem());
    107                 }
    108 
    109                 if(effect2_ != "")
    110                 {
    111                         this->effect2Particle_ = new ParticleInterface(this->getScene()->getSceneManager(), effect2_, this->LOD_);
    112                         this->model_->attachOgreObject(this->effect2Particle_->getParticleSystem());
    113                 }       
    114 
    115                 this->explosionEntity_->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(minSpeed_,maxSpeed_));
    116         this->explosionEntity_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
    117         this->explosionEntity_->setScale(4);
    118 
    119         this->explosionEntity_->attach(model_);
    120 
    121         this->attach(explosionEntity_);
    122 
    123         if (GameMode::isMaster())
    124         {
    125             this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&ExplosionPart::stop, this)));
    126         }
    127 
     95                this->destroyTimer_.setTimer(delay_, false, createExecutor(createFunctor(&ExplosionPart::ActuallyExplode, this)));
    12896        }
    12997
     
    144112        }
    145113
     114        void ExplosionPart::ActuallyExplode()
     115        {
     116                this->model_->setVisible(true);
     117
     118                //this->explosionEntity_->setSyncMode(0);
     119
     120                //this->model_->setSyncMode(0);
     121
     122                if(effect1_ != "")
     123                {
     124                        this->effect1Particle_ = new ParticleInterface(this->getScene()->getSceneManager(), effect1_, this->LOD_);
     125                        this->model_->attachOgreObject(this->effect1Particle_->getParticleSystem());
     126                }
     127
     128                if(effect2_ != "")
     129                {
     130                        this->effect2Particle_ = new ParticleInterface(this->getScene()->getSceneManager(), effect2_, this->LOD_);
     131                        this->model_->attachOgreObject(this->effect2Particle_->getParticleSystem());
     132                }
     133
     134               
     135        Vector3 velocityOffset = direction_.perpendicular();
     136        velocityOffset.normalise();
     137        Degree offsetDirection = Degree(rnd(0,360));
     138        velocityOffset = Quaternion(offsetDirection, direction_.normalisedCopy()) * velocityOffset;
     139        velocityOffset.normalise();
     140        direction_.normalise();
     141
     142        Vector3 finalDirection = direction_ + sin((rnd(0, angle_))*M_PI/180)*velocityOffset;
     143
     144                this->explosionEntity_->setVelocity(finalDirection*rnd(minSpeed_,maxSpeed_));
     145        this->explosionEntity_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
     146        this->explosionEntity_->setScale(size_);
     147
     148        this->explosionEntity_->attach(model_);
     149
     150        this->attach(explosionEntity_);
     151
     152        if (GameMode::isMaster())
     153        {
     154            this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&ExplosionPart::stop, this)));
     155        }
     156        }
     157
    146158
    147159
     
    180192        {
    181193                this->posOffset_ = newVector;
    182                 this->setPosition(this->getPosition() + this->posOffset_);
     194                this->explosionEntity_->setPosition(this->getPosition() + this->posOffset_);
     195        }
     196
     197        void ExplosionPart::setDirection(Vector3 newDirection)
     198        {
     199                this->direction_ = newDirection;
     200        }
     201
     202        void ExplosionPart::setAngle(float newAngle)
     203        {
     204                this->angle_ = newAngle;
     205        }
     206
     207        void ExplosionPart::setSize(float newSize)
     208        {
     209                this->size_ = newSize;
     210        }
     211
     212        void ExplosionPart::setDelay(float newDelay)
     213        {
     214                this->delay_ = newDelay;
    183215        }
    184216
     
    207239        }
    208240
     241        Vector3 ExplosionPart::getDirection()
     242        {
     243                return direction_;
     244        }
     245
     246        float ExplosionPart::getAngle()
     247        {
     248                return angle_;
     249        }
     250
     251        float ExplosionPart::getSize()
     252        {
     253                return size_;
     254        }
     255
     256        float ExplosionPart::getDelay()
     257        {
     258                return delay_;
     259        }
     260
    209261
    210262
  • code/branches/explosionChunksHS15/src/orxonox/worldentities/ExplosionPart.h

    r10810 r10837  
    5454            void Explode();
    5555            void stop();
     56            void ActuallyExplode();
    5657
    5758            void setMesh(const std::string& newString);
     
    6768            void setOffset(Vector3 newVector);
    6869            Vector3 getOffset();
     70            void setDirection(Vector3 newDirection);
     71            Vector3 getDirection();
     72            void setAngle(float newAgnle);
     73            float getAngle();
     74            void setSize(float newSize);
     75            float getSize();
     76            void setDelay(float newDelay);
     77            float getDelay();
    6978         
    7079
     
    8695            std::string effect2_;
    8796            Vector3 posOffset_;
     97            Vector3 direction_;
     98            float angle_;
     99            float size_;
     100            float delay_;
    88101
    89102            MovableEntity* explosionEntity_;
  • code/branches/explosionChunksHS15/src/orxonox/worldentities/pawns/Pawn.cc

    r10810 r10837  
    390390            explosionPartList_.back()->setPosition(this->getPosition());
    391391            explosionPartList_.back()->setVelocity(this->getVelocity());
     392            explosionPartList_.back()->setOrientation(this->getOrientation());
    392393            explosionPartList_.back()->Explode();
    393394            explosionPartList_.pop_back();
Note: See TracChangeset for help on using the changeset viewer.