- Timestamp:
- Jan 8, 2007, 9:46:13 PM (18 years ago)
- Location:
- branches/playability/src/world_entities
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/projectiles/projectile.h
r10104 r10196 87 87 OrxSound::SoundBuffer explosionBuffer; 88 88 OrxSound::SoundBuffer engineBuffer; 89 90 // virtual Vector newDirection(Vector curDirection, Vector estTargetDir, float angle);91 89 }; 92 90 -
branches/playability/src/world_entities/projectiles/spike.cc
r10173 r10196 165 165 float matrix[4][4]; 166 166 glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); 167 167 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 168 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 168 169 glRotatef(angle, 1.0, 0.0, 0.0); 169 170 this->getAbsDir().matrix (matrix); -
branches/playability/src/world_entities/projectiles/spike.h
r10173 r10196 34 34 virtual void draw () const; 35 35 36 36 inline void setVelocity(Vector velocity) {this->velocity = velocity;} 37 37 private: 38 38 static FastFactory* fastFactory; -
branches/playability/src/world_entities/projectiles/spike_ball.cc
r10188 r10196 32 32 33 33 #include "weapons/weapon.h" 34 34 #include "../weapons/weapon_manager.h" 35 35 36 36 #include "class_id_DEPRECATED.h" … … 65 65 this->halo->setSize(2, 2); 66 66 this->halo->setTexture("hbolt_halo.png"); 67 /* 68 //this->weaponMan = new WeaponManager(dynamic_cast<WorldEntity*>(this));69 this->weaponMan .setParentEntity(this);67 68 this->weaponMan = new WeaponManager(dynamic_cast<WorldEntity*>(this)); 69 this->weaponMan->setParentEntity(this); 70 70 71 71 Weapon* cannon = new SpikeLauncher(); 72 72 cannon->setName( "SpikeLauncher"); 73 this->weaponMan .addWeapon(cannon, 0, 0);74 this->weaponMan .changeWeaponConfig(0);75 */ 73 this->weaponMan->addWeapon(cannon, 0, 0); 74 this->weaponMan->changeWeaponConfig(0); 75 76 76 77 77 } … … 177 177 178 178 if (this->tickLifeCycle(dt)){ 179 // this->blow();179 this->weaponMan->fire(); 180 180 this->deactivate(); 181 181 } -
branches/playability/src/world_entities/projectiles/spike_ball.h
r10188 r10196 11 11 12 12 #include "../weapons/spike_launcher.h" 13 #include "../weapons/weapon.h" 14 #include "../weapons/weapon_manager.h" 13 14 15 #include "extendable.h" 15 16 16 17 class Vector; … … 62 63 WorldEntity* hitEntity; // FIXME TEMPORARY 63 64 64 // WeaponManagerweaponMan;65 WeaponManager* weaponMan; 65 66 66 67 }; -
branches/playability/src/world_entities/projectiles/swarm_projectile.cc
r10188 r10196 1 2 1 /* 3 2 orxonox - the future of 3D-vertical-scrollers … … 187 186 void SwarmProjectile::tick (float time) 188 187 { 188 if(unlikely(this->target == NULL)) /** Check whether the target still exists*/ 189 this->deactivate(); 190 189 191 /* 190 192 Vector targetFarFarAway = this->getAbsCoor() + Vector(100000, 0, 0); -
branches/playability/src/world_entities/space_ships/space_ship.cc
r10194 r10196 28 28 #include "weapons/swarm_launcher.h" 29 29 #include "weapons/spike_launcher.h" 30 #include "weapons/spike_thrower.h" 30 31 #include "weapons/boomerang_gun.h" 31 32 #include "weapons/turret.h" … … 173 174 Weapon* cannon = new SwarmLauncher(); 174 175 cannon->setName( "SwarmLauncher"); 175 //cannon->setParent( this); 176 177 Weapon* spike = new SpikeLauncher(); 178 spike->setName( "SpikeThrower" ); 176 179 177 180 … … 195 198 196 199 this->secWeaponMan.addWeapon( cannon, 0, 0); 200 this->secWeaponMan.addWeapon( spike, 1, 1); 197 201 198 202 -
branches/playability/src/world_entities/weapons/spike_launcher.cc
r10188 r10196 102 102 this->size = 2.5; 103 103 104 this->setEmissionPoint(0.0, 0.0, 0.0); 105 106 104 107 this->spikes = 26; 105 108 this->launcher = new Vector [this->spikes]; … … 128 131 } 129 132 130 // this->setEmissionPoint(1.684, 0.472, 0);131 133 this->getProjectileFactory()->prepare(this->spikes); //we don't need more... 132 134 133 this->setActionSound(WA_SHOOT, "sound/explosions/explosion_1.wav");134 this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav");135 this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav");135 // this->setActionSound(WA_SHOOT, "sound/explosions/explosion_1.wav"); 136 // this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav"); 137 // this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav"); 136 138 137 139 } … … 179 181 180 182 float nx, ny, nz, ca, sa; 183 181 184 nx = v.x; 182 185 ny = v.y; … … 187 190 // final version below... easier to to cheat with the one above. 188 191 /* 189 nx = this->getParent()->getRotationVector().x 190 ny = this->getParent()->getRotationVector().y 191 nz = this->getParent()->getRotationVector().z 192 nx = this->getParent()->getRotationVector().x; 193 ny = this->getParent()->getRotationVector().y; 194 nz = this->getParent()->getRotationVector().z; 192 195 193 196 ca = cos (this->getParent()->getAngle()); … … 212 215 this->launcher[i] = Vector (x, y, z); 213 216 } 217 218 for( int i = 0; i < 3 ; i++) 219 delete m[i]; 220 delete m; 214 221 } 215 222 … … 222 229 223 230 Projectile* pj = NULL; 224 // for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++)225 231 for (int i = 0; i < this->spikes; i++) 226 232 { … … 230 236 231 237 // pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*115.0 + VECTOR_RAND(10))); 232 pj->setVelocity(this->launcher[i] * 200.0);238 pj->setVelocity(this->launcher[i] * 300.0); 233 239 234 240 pj->setParent(PNode::getNullParent()); 235 241 pj->setAbsCoor(this->getAbsCoor() + this->launcher[i] * this->size); 236 pj->setAbsDir(Quaternion(this->launcher[i], 0)); 242 pj->setRelDir(0, this->launcher[i].x, this->launcher[i].y, this->launcher[i].z); 243 244 pj->toList(this->getOMListNumber()); 237 245 pj->activate(); 238 246 } -
branches/playability/src/world_entities/weapons/spike_thrower.cc
r10180 r10196 146 146 void SpikeThrower::fire() 147 147 { 148 bool fired = false; 148 Projectile* pj = this->getProjectile(); 149 if (pj == NULL) 150 return; 149 151 150 Projectile* pj = NULL; 151 for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++) 152 { 153 if( ((*eIterator)->getOMListNumber() == OM_GROUP_00) && ((*eIterator)->getClassCName() != "Weapon") && ((*eIterator)->getClassCName() != "Projectile") && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 300) 154 { 155 pj = this->getProjectile(); 156 if (pj == NULL) 157 return; 158 159 fired = true; 160 pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*115.0 + VECTOR_RAND(10))); 152 // set the owner 153 pj->setOwner(this->getOwner()); 161 154 162 pj->setParent(PNode::getNullParent()); 163 pj->setAbsCoor(this->getEmissionPoint()); 164 pj->setAbsDir(this->getAbsDir()); 165 // dynamic_cast<SpikeProjectile*>(pj)->setTarget( (PNode*)(*eIterator) ); 166 pj->toList(OM_GROUP_01_PROJ); 167 pj->activate(); 168 } 169 } 170 if( !fired) 171 this->increaseEnergy( this->getProjectile()->getMinEnergy()); 155 pj->setParent(PNode::getNullParent()); 156 157 pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*150); 158 pj->setAbsCoor(this->getEmissionPoint()); 159 160 pj->setAbsDir(this->getAbsDir()); 161 pj->activate(); 172 162 }
Note: See TracChangeset
for help on using the changeset viewer.