Changeset 10188 in orxonox.OLD for branches/playability/src/world_entities/projectiles
- Timestamp:
- Jan 7, 2007, 2:50:47 PM (18 years ago)
- Location:
- branches/playability/src/world_entities/projectiles
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/projectiles/spike_ball.cc
r10180 r10188 60 60 61 61 this->angle = 0; 62 this->rotationSpeed = 0; 62 this->rotationSpeed = 130; 63 64 this->halo = new Billboard(); 65 this->halo->setSize(2, 2); 66 this->halo->setTexture("hbolt_halo.png"); 63 67 /* 64 this->halo = new Billboard(); 65 this->halo->setSize(.35, .35); 66 this->halo->setTexture("hbolt_halo.png");*/ 68 // this->weaponMan = new WeaponManager(dynamic_cast<WorldEntity*>(this)); 69 this->weaponMan.setParentEntity(this); 70 71 Weapon* cannon = new SpikeLauncher(); 72 cannon->setName( "SpikeLauncher"); 73 this->weaponMan.addWeapon(cannon, 0, 0); 74 this->weaponMan.changeWeaponConfig(0); 75 */ 76 67 77 } 68 78 … … 105 115 this->setDamage(5); 106 116 this->setHealth(0); 117 this->rotationVector = VECTOR_RAND(1); 107 118 } 108 119 … … 197 208 glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); 198 209 199 glRotatef(angle, 1.0, 0.0, 0.0);210 glRotatef(angle, this->rotationVector.x, this->rotationVector.y, this->rotationVector.z); 200 211 this->getAbsDir().matrix (matrix); 201 212 glMultMatrixf((float*)matrix); -
branches/playability/src/world_entities/projectiles/spike_ball.h
r10170 r10188 9 9 #include "projectile.h" 10 10 #include "effects/billboard.h" 11 12 #include "../weapons/spike_launcher.h" 11 13 #include "../weapons/weapon.h" 14 #include "../weapons/weapon_manager.h" 12 15 13 16 class Vector; … … 16 19 class ParticleEmitter; 17 20 class FastFactory; 21 class WeaponManager; 22 18 23 19 24 class SpikeBall : public Projectile … … 35 40 virtual void draw () const; 36 41 42 inline Vector getRotationVector() { return this->rotationVector; } 43 inline float getAngle() { return this->angle; } 44 37 45 // virtual void blow(); 38 46 … … 48 56 float angle; 49 57 float rotationSpeed; 58 Vector rotationVector; 50 59 51 60 Billboard* halo; 52 61 53 62 WorldEntity* hitEntity; // FIXME TEMPORARY 63 64 // WeaponManager weaponMan; 65 54 66 }; 55 67 -
branches/playability/src/world_entities/projectiles/swarm_projectile.cc
r10168 r10188 268 268 269 269 this->angle += this->rotationSpeed * time; 270 while (this->angle > 360) 271 this->angle -= 360; 270 272 271 273 this->lastDir = this->curDir; … … 309 311 glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); 310 312 Vector tmpRot = this->getAbsCoor().cross(tmpDir); 311 glRotatef (angle Deg( this->getAbsCoor(), tmpDir), tmpRot.x, tmpRot.y, tmpRot.z );313 glRotatef (angleRad ( this->getAbsCoor(), tmpDir), tmpRot.x, tmpRot.y, tmpRot.z ); 312 314 glRotatef(this->angle, 1.0f, 0.0f, 0.0f); //spinning missile 313 315 this->getAbsDir().matrix (matrix);
Note: See TracChangeset
for help on using the changeset viewer.