Changeset 6811 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Jan 28, 2006, 4:02:06 PM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/projectiles/hyperblast.cc
r6810 r6811 40 40 41 41 float modelSize = .3; 42 this->loadModel("models/projectiles/ orx-hyperblast.obj", .3);42 this->loadModel("models/projectiles/hyperblast.obj", 5); 43 43 44 44 this->setMinEnergy(1); … … 58 58 { 59 59 /* this is normaly done by World.cc by deleting the ParticleEngine */ 60 if (Hyperblast::extParticles != NULL && ClassList::getList(CL_HYPERBLAST)->size() <= 1)61 {62 Hyperblast::extParticles = NULL;63 }64 60 if (Hyperblast::explosionParticles != NULL && ClassList::getList(CL_HYPERBLAST)->size() <= 1) 65 61 { … … 69 65 } 70 66 71 SpriteParticles* Hyperblast::extParticles = NULL;72 67 SparkParticles* Hyperblast::explosionParticles = NULL; 73 68 74 69 void Hyperblast::activate() 75 70 { 76 if (unlikely(Hyperblast::extParticles == NULL))77 {78 Hyperblast::extParticles = new SpriteParticles(2000);79 Hyperblast::extParticles->setName("HyperblastTrailParticles");80 Hyperblast::extParticles->setMaterialTexture("maps/radial-trans-noise.png");81 Hyperblast::extParticles->setLifeSpan(1.0, .3);82 Hyperblast::extParticles->setRadius(0.0, .5);83 Hyperblast::extParticles->setRadius(0.2, 2.0);84 Hyperblast::extParticles->setRadius(.5, .8);85 Hyperblast::extParticles->setRadius(1.0, .8);86 Hyperblast::extParticles->setColor(0.0, 1,0,0,.7);87 Hyperblast::extParticles->setColor(0.2, .8,.8,0,.5);88 Hyperblast::extParticles->setColor(0.5, .8,.8,.8,.8);89 Hyperblast::extParticles->setColor(1.0, .8,.8,.8,.0);90 }91 71 if (unlikely(Hyperblast::explosionParticles == NULL)) 92 72 { … … 103 83 } 104 84 105 this->emitter->setSystem(Hyperblast::ex tParticles);85 this->emitter->setSystem(Hyperblast::explosionParticles); 106 86 107 87 this->updateNode(0); 108 this->emitter->setEmissionRate( 45.0);88 this->emitter->setEmissionRate(245.0); 109 89 this->emitter->setEmissionVelocity(0.0); 110 90 } … … 125 105 void Hyperblast::collidesWith(WorldEntity* entity, const Vector& location) 126 106 { 127 if (this->hitEntity != entity)128 this->destroy();129 this->hitEntity = entity;130 107 } 131 108 … … 136 113 void Hyperblast::tick (float dt) 137 114 { 138 //Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.1);139 Vector v = this->velocity * (dt);140 this->shiftCoor(v);141 142 115 if(this->tickLifeCycle(dt)) 143 116 this->deactivate(); … … 150 123 { 151 124 PRINTF(5)("DESTROY Hyperblast\n"); 152 this->lifeCycle = .95; //!< @todo calculate this usefully.153 this->emitter->setSystem(Hyperblast::explosionParticles);154 125 155 this->emitter->setEmissionRate(1000.0);156 this->emitter->setEmissionVelocity(50.0);157 // this->deactivate();158 126 159 127 } -
trunk/src/world_entities/projectiles/hyperblast.h
r6810 r6811 11 11 class Vector; 12 12 class Weapon; 13 class SpriteParticles;14 13 class SparkParticles; 15 14 class ParticleEmitter; … … 36 35 private: 37 36 static FastFactory* fastFactory; 38 static SpriteParticles* extParticles;39 37 static SparkParticles* explosionParticles; 40 38 -
trunk/src/world_entities/space_ships/hover.cc
r6807 r6811 76 76 Weapon* wpLeft = new TestGun(1); 77 77 wpLeft->setName("testGun Left"); 78 Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate(CL_ CANNON));78 Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate(CL_HYPERBLASTER)); 79 79 80 80 cannon->setName("BFG"); -
trunk/src/world_entities/weapons/cannon.cc
r6803 r6811 74 74 // this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN); 75 75 76 this->loadModel("models/guns/ plasmadriver_#.obj", 2.0);76 this->loadModel("models/guns/cannon.obj", 1.0); 77 77 78 78 this->setStateDuration(WS_SHOOTING, 2.0); -
trunk/src/world_entities/weapons/hyperblaster.cc
r6810 r6811 66 66 this->setStateDuration(WS_SHOOTING, 2.0); 67 67 this->setStateDuration(WS_RELOADING, 5.0); 68 this->setStateDuration(WS_ACTIVATING, . 1);69 this->setStateDuration(WS_DEACTIVATING, . 4);68 this->setStateDuration(WS_ACTIVATING, .8); 69 this->setStateDuration(WS_DEACTIVATING, .8); 70 70 71 71 this->setEnergyMax(10); … … 97 97 // animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_NULL); 98 98 99 animation2->addKeyFrame(Vector(1.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 100 animation2->addKeyFrame(Vector(1.0, 0.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 101 animation2->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 99 animation2->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 100 animation2->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL); 102 101 103 animation3->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 104 animation3->addKeyFrame(Vector(1.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 105 animation2->addKeyFrame(Vector(1.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 102 animation3->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL); 103 animation3->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 106 104 } 107 105
Note: See TracChangeset
for help on using the changeset viewer.