Changeset 10217 in orxonox.OLD for branches/playability/src/world_entities
- Timestamp:
- Jan 10, 2007, 3:37:40 PM (18 years ago)
- Location:
- branches/playability/src/world_entities
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/projectiles/spike_ball.cc
r10196 r10217 74 74 this->weaponMan->changeWeaponConfig(0); 75 75 76 76 this->ttd = false; 77 77 } 78 78 … … 177 177 178 178 if (this->tickLifeCycle(dt)){ 179 this->weaponMan->fire(); 180 this->deactivate(); 179 this->weaponMan->getWeapon(0)->requestAction(WA_SHOOT); 180 if (this->ttd) 181 this->deactivate(); 182 this->ttd = true; 181 183 } 182 184 -
branches/playability/src/world_entities/projectiles/spike_ball.h
r10196 r10217 65 65 WeaponManager* weaponMan; 66 66 67 bool ttd; 67 68 }; 68 69 -
branches/playability/src/world_entities/space_ships/space_ship.cc
r10196 r10217 202 202 203 203 this->weaponMan.changeWeaponConfig(3); 204 this->secWeaponMan.changeWeaponConfig( 0);204 this->secWeaponMan.changeWeaponConfig(1); 205 205 206 206 curWeaponPrimary = 3; -
branches/playability/src/world_entities/weapons/spike_launcher.cc
r10196 r10217 108 108 this->launcher = new Vector [this->spikes]; 109 109 110 this->getProjectileFactory()->prepare(this->spikes); //we don't need more... 111 112 // this->setActionSound(WA_SHOOT, "sound/explosions/explosion_1.wav"); 113 // this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav"); 114 // this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav"); 115 116 } 117 118 void SpikeLauncher::loadParams(const TiXmlElement* root) 119 { 120 Weapon::loadParams(root); 121 } 122 123 void SpikeLauncher::activate() 124 { 110 125 this->launcher[0] = Vector(1.0, 0.0, 0.0); 111 126 this->launcher[1] = Vector(0.0, 1.0, 0.0); … … 130 145 this->launcher[tmp + i] = this->launcher[i] * (-1); 131 146 } 132 133 this->getProjectileFactory()->prepare(this->spikes); //we don't need more...134 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");138 139 }140 141 void SpikeLauncher::loadParams(const TiXmlElement* root)142 {143 Weapon::loadParams(root);144 }145 146 void SpikeLauncher::activate()147 {148 147 } 149 148 … … 196 195 ca = cos (this->getParent()->getAngle()); 197 196 sa = sin (this->getParent()->getAngle());*/ 197 /* 198 float * m = new float [9]; 199 m[0] = 1.0f+(1.0f-ca)*(nx*nx-1.0f); 200 m[1] = -nz*sa+(1.0f-ca)*nx*ny; 201 m[2] = ny*sa+(1.0f-ca)*nx*nz; 202 m[3] = nz*sa+(1.0f-ca)*nx*ny; 203 m[4] = 1.0f+(1.0f-ca)*(ny*ny-1.0f); 204 m[5] = -nx*sa+(1.0f-ca)*ny*nz; 205 m[6] = -ny*sa+(1.0f-ca)*nx*nz; 206 m[7] = nx*sa+(1.0f-ca)*ny*nz; 207 m[8] = 1.0f+(1.0f-ca)*(nz*nz-1.0f);*/ 198 208 199 209 m[0][0] = nx * nx * (1 - ca) + ca; … … 209 219 float x, y, z; 210 220 for (int i = 0; i < this->spikes;i++){ 221 211 222 x = m[0][0] * this->launcher[i].x + m[0][1] * this->launcher[i].y + m[0][2] * this->launcher[i].z; 212 223 y = m[1][0] * this->launcher[i].x + m[1][1] * this->launcher[i].y + m[1][2] * this->launcher[i].z; 213 224 z = m[2][0] * this->launcher[i].x + m[2][1] * this->launcher[i].y + m[2][2] * this->launcher[i].z; 214 225 /* 226 x = this->launcher[i].x * m[0] + this->launcher[i].y * m[1] + this->launcher[i].z * m[2]; 227 y = this->launcher[i].x * m[3] + this->launcher[i].y * m[4] + this->launcher[i].z * m[5]; 228 z = this->launcher[i].x * m[6] + this->launcher[i].y * m[7] + this->launcher[i].z * m[8];*/ 215 229 this->launcher[i] = Vector (x, y, z); 216 230 } … … 224 238 void SpikeLauncher::fire() 225 239 { 226 // temporary solution to test module240 // temporary solution to test the module 227 241 updateFireDir(VECTOR_RAND(1), 20); 228 242 229 243 printf("fireing spikes\n"); 230 244 Projectile* pj = NULL; 231 245 for (int i = 0; i < this->spikes; i++) … … 240 254 pj->setParent(PNode::getNullParent()); 241 255 pj->setAbsCoor(this->getAbsCoor() + this->launcher[i] * this->size); 242 pj->setRelDir(0, this->launcher[i].x, this->launcher[i].y, this->launcher[i].z); 256 // Quaternion q; 257 // pj->setRelDir(q.lookAt(Vector(), this->launcher[i], VECTOR_RAND(1))); 258 pj->setRelDir(90, this->launcher[i].x, this->launcher[i].y, this->launcher[i].z); 243 259 244 260 pj->toList(this->getOMListNumber()); -
branches/playability/src/world_entities/weapons/spike_launcher.h
r10188 r10217 28 28 virtual void fire(); 29 29 30 virtual void updateFireDir(Vector v, float angle);30 virtual void updateFireDir(Vector t, float angle); 31 31 32 32 private:
Note: See TracChangeset
for help on using the changeset viewer.