Changeset 10042 in orxonox.OLD for branches/playability/src
- Timestamp:
- Dec 12, 2006, 3:35:25 PM (18 years ago)
- Location:
- branches/playability/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/util/hud.cc
r10030 r10042 237 237 std::list<OrxGui::GLGuiWidget*>::iterator weaponWidget; 238 238 Vector2D pos(0.3, .9); 239 for (weaponWidget = this->weaponsWidgets.begin(); weaponWidget != this->weaponsWidgets.end(); weaponWidget++, pos.x+=. 2)239 for (weaponWidget = this->weaponsWidgets.begin(); weaponWidget != this->weaponsWidgets.end(); weaponWidget++, pos.x+=.1) 240 240 { 241 241 if (pos.x > .8) -
branches/playability/src/world_entities/projectiles/mbolt.cc
r10036 r10042 29 29 #include "debug.h" 30 30 31 #include "static_model.h" 32 31 33 32 34 #include "class_id_DEPRECATED.h" … … 39 41 { 40 42 41 //this->loadModel("models/projectiles/mbolt.obj"); //!< Model not yet in repo42 this->loadModel("models/projectiles/laser.obj");43 this->loadModel("models/projectiles/mbolt.obj",0.25); 44 //this->loadModel("models/projectiles/laser.obj"); 43 45 44 46 this->setMinEnergy(4); 45 47 this->setHealthMax(0); 46 48 this->lifeSpan = 5.0; 47 48 this->emitter = new DotEmitter(100, 5, M_2_PI); 49 this->angle = 0; 50 51 this->emitter = new DotEmitter(40, 0, M_2_PI); 49 52 this->emitter->setParent(this); 50 53 this->emitter->setSpread(M_PI, M_PI); 51 54 this->emitter->setEmissionRate(300.0); 52 55 this->emitter->setEmissionVelocity(50.0); 56 57 this->mat = new Material("mBolt"); 58 //this->mat->setBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); 59 this->mat->setBlendFunc(GL_SRC_ALPHA,GL_ONE); 60 this->mat->setDiffuse(1,1,1); 61 this->mat->setDiffuseMap("laser.png"); 62 this->mat->setDiffuseMap("laser.png",1); 63 dynamic_cast<StaticModel*>(this->getModel())->addMaterial(this->mat); 64 dynamic_cast<StaticModel*>(this->getModel())->finalize(); 53 65 } 54 66 … … 56 68 /** 57 69 * standard deconstructor 70 71 /** 58 72 */ 59 73 MBolt::~MBolt () … … 61 75 // delete this->emitter; 62 76 63 /* this is normaly done by World.cc by deleting the ParticleEngine */ 77 if (MBolt::trailParticles != NULL && MBolt::objectList().size() <= 1) 78 { 79 if (ParticleSystem::objectList().exists(MBolt::trailParticles)) 80 delete MBolt::trailParticles; 81 MBolt::trailParticles = NULL; 82 } 64 83 if (MBolt::explosionParticles != NULL && MBolt::objectList().size() <= 1) 65 84 { 66 //if (ClassList::exists(MBolt::explosionParticles, CL_PARTICLE_SYSTEM)) 67 // delete MBolt::explosionParticles; 68 PRINTF(1)("Deleting MBolt Particles\n"); 85 if (ParticleSystem::objectList().exists(MBolt::explosionParticles)) 86 delete MBolt::explosionParticles; 69 87 MBolt::explosionParticles = NULL; 70 88 } 71 72 } 73 89 } 90 91 SpriteParticles* MBolt::trailParticles = NULL; 74 92 SpriteParticles* MBolt::explosionParticles = NULL; 75 93 76 94 void MBolt::activate() 77 95 { 96 if (unlikely(MBolt::trailParticles == NULL)) 97 { 98 MBolt::trailParticles = new SpriteParticles(3000); 99 MBolt::trailParticles->setName("BoomerangProjectileTrailParticles"); 100 MBolt::trailParticles->setMaterialTexture("maps/radial-trans-noise.png"); 101 MBolt::trailParticles->setLifeSpan(1, 0); 102 MBolt::trailParticles->setRadius(0.0, 1); 103 MBolt::trailParticles->setRadius(1.0, 1); 104 MBolt::trailParticles->setColor(0.0, 1,0,0,.9); 105 MBolt::trailParticles->setColor(0.2, .8,.2,0,.9); 106 MBolt::trailParticles->setColor(0.5, .8,.4,0,.8); 107 MBolt::trailParticles->setColor(1.0, .8,.8,0,.7); 108 } 78 109 if (unlikely(MBolt::explosionParticles == NULL)) 79 110 { … … 91 122 this->setDamage(50); 92 123 this->setHealth(0); 124 125 this->emitter->setSystem(MBolt::trailParticles); 126 127 this->updateNode(0); 128 this->emitter->setSpread(0); 129 this->emitter->setEmissionRate(20.0); 130 this->emitter->setEmissionVelocity(this->velocity.len()); 93 131 } 94 132 … … 96 134 void MBolt::deactivate() 97 135 { 136 assert (MBolt::trailParticles != NULL); 137 MBolt::trailParticles->removeEmitter(this->emitter); 138 98 139 assert (MBolt::explosionParticles != NULL); 99 140 MBolt::explosionParticles->removeEmitter(this->emitter); … … 125 166 if (this->tickLifeCycle(dt)) 126 167 this->deactivate(); 168 169 this->angle += MBolt::rotationSpeed * dt; 127 170 } 128 171 … … 145 188 glDisable(GL_LIGHTING); 146 189 147 WorldEntity::draw(); 148 190 glPushMatrix(); 191 192 float matrix[4][4]; 193 glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); 194 glRotatef(this->angle, 1.0f, 0.0f, 0.0f); //spinning missile 195 this->getAbsDir().matrix (matrix); 196 glMultMatrixf((float*)matrix); 197 198 glScalef(3.0, 0.7, 0.7); // no double rescale 199 200 this->mat->select(); 201 dynamic_cast<StaticModel*>(this->getModel())->draw(); 202 this->mat->unselect(); 203 glPopMatrix(); 149 204 glPopAttrib(); 150 } 151 205 206 207 } 208 -
branches/playability/src/world_entities/projectiles/mbolt.h
r9999 r10042 8 8 9 9 #include "projectile.h" 10 #include "material.h" 10 11 11 12 class Vector; … … 36 37 private: 37 38 static FastFactory* fastFactory; 38 39 static SpriteParticles* trailParticles; 39 40 static SpriteParticles* explosionParticles; 40 41 42 float angle; 43 static const float rotationSpeed = 540; 44 41 45 ParticleEmitter* emitter; 46 47 Material* mat; 42 48 43 49 -
branches/playability/src/world_entities/weapons/medium_blaster.cc
r10036 r10042 96 96 pj->setParent(PNode::getNullParent()); 97 97 98 pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))* 250 + VECTOR_RAND(5));98 pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*150); 99 99 100 100 pj->setAbsCoor(this->getEmissionPoint());
Note: See TracChangeset
for help on using the changeset viewer.