Changeset 10837
- Timestamp:
- Nov 23, 2015, 3:46:58 PM (9 years ago)
- Location:
- code/branches/explosionChunksHS15
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/explosionChunksHS15/data/levels/HeavyCruiser.oxw
r10807 r10837 552 552 All Pawns can easily be included into a level using the lua file "HeavyCruiserParts" --> 553 553 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 /> 559 571 </explosion> 560 572 <attached> … … 724 736 <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" > 725 737 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" /> 730 742 </explosion> 731 743 … … 770 782 <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" > 771 783 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" /> 776 788 </explosion> 777 789 … … 790 802 791 803 <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" /> 796 808 </explosion> 797 809 <attached> … … 834 846 835 847 <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" /> 840 852 </explosion> 841 853 <attached> … … 853 865 854 866 <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" /> 859 871 </explosion> 860 872 <attached> … … 869 881 870 882 <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" /> 875 887 </explosion> 876 888 <attached> … … 885 897 886 898 <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" /> 891 903 </explosion> 892 904 <attached> … … 901 913 902 914 <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" /> 907 919 </explosion> 908 920 <attached> -
code/branches/explosionChunksHS15/data/levels/emptyLevel.oxw
r10810 r10837 15 15 include("templates/spaceshipAssff.oxt") 16 16 include("templates/spaceshipEscort.oxt") 17 include("templates/spaceshipPirate.oxt") 17 18 ?> 18 19 … … 44 45 > 45 46 <templates> 46 <Template link=spaceship assff/>47 <Template link=spaceshippirate /> 47 48 </templates> 48 49 -
code/branches/explosionChunksHS15/data/levels/templates/spaceshipAssff.oxt
r10810 r10837 56 56 <BoxCollisionShape position="0,0.1,-19" halfExtents="1.4, 1, 2" /> 57 57 </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" /> 62 62 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 /> 68 67 </explosion> 69 68 <?lua -
code/branches/explosionChunksHS15/data/levels/templates/spaceshipEscort.oxt
r10807 r10837 56 56 <BoxCollisionShape position="0, 0,-12" halfExtents="4 , 4 ,7" /> 57 57 </collisionShapes> 58 <explosion 58 <explosion> 59 59 <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" /> 60 60 <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" /> 61 61 <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" /> 62 62 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" /> 68 69 </explosion> 69 70 <?lua -
code/branches/explosionChunksHS15/data/levels/templates/spaceshipPirate.oxt
r10807 r10837 53 53 <BoxCollisionShape position="0,0.1,-19" halfExtents="1.4, 1, 2" /> 54 54 </collisionShapes> 55 <explosion 55 <explosion> 56 56 <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" /> 57 57 <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" /> 58 58 <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" /> 59 59 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" /> 65 64 </explosion> 66 65 -
code/branches/explosionChunksHS15/src/orxonox/worldentities/ExplosionPart.cc
r10810 r10837 84 84 XMLPortParam(ExplosionPart, "effect2", setEffect2, getEffect2, xmlelement, mode).defaultValues(""); 85 85 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); 88 90 } 89 91 … … 91 93 void ExplosionPart::Explode() 92 94 { 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))); 128 96 } 129 97 … … 144 112 } 145 113 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 146 158 147 159 … … 180 192 { 181 193 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; 183 215 } 184 216 … … 207 239 } 208 240 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 209 261 210 262 -
code/branches/explosionChunksHS15/src/orxonox/worldentities/ExplosionPart.h
r10810 r10837 54 54 void Explode(); 55 55 void stop(); 56 void ActuallyExplode(); 56 57 57 58 void setMesh(const std::string& newString); … … 67 68 void setOffset(Vector3 newVector); 68 69 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(); 69 78 70 79 … … 86 95 std::string effect2_; 87 96 Vector3 posOffset_; 97 Vector3 direction_; 98 float angle_; 99 float size_; 100 float delay_; 88 101 89 102 MovableEntity* explosionEntity_; -
code/branches/explosionChunksHS15/src/orxonox/worldentities/pawns/Pawn.cc
r10810 r10837 390 390 explosionPartList_.back()->setPosition(this->getPosition()); 391 391 explosionPartList_.back()->setVelocity(this->getVelocity()); 392 explosionPartList_.back()->setOrientation(this->getOrientation()); 392 393 explosionPartList_.back()->Explode(); 393 394 explosionPartList_.pop_back();
Note: See TracChangeset
for help on using the changeset viewer.