- Timestamp:
- Jan 24, 2007, 6:13:17 PM (18 years ago)
- Location:
- branches/playability/src
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/lib/util/loading/fast_factory.cc
r9869 r10345 157 157 void FastFactory::flush(bool hardFLUSH) 158 158 { 159 hardFLUSH = false; // HACK 159 160 FastObjectMember* tmpMember = this->deadList, *delMember = NULL; 160 161 while (tmpMember != NULL) -
branches/playability/src/world_entities/effects/wobblegrid.cc
r10333 r10345 81 81 82 82 this->material = new Material(); 83 this->material->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 83 84 this->setAbsCoor(0, 0, 0); 84 85 //this->setVisibiliy(true); -
branches/playability/src/world_entities/projectiles/acid_splash.cc
r10333 r10345 56 56 57 57 58 int rnd = rand()/3;58 int rnd = int(rand() % 3); 59 59 60 60 switch (rnd){ … … 76 76 // this->grid->setTexture( "maps/blub.png"); 77 77 78 this->grid->toList(OM_ENVIRON); //this->getOMListNumber()); 79 this->toList(OM_ENVIRON); 78 this->grid->toList(OM_ENVIRON); 80 79 } 81 80 … … 89 88 // delete this->emitter; 90 89 //delete this->grid; 91 92 90 this->grid->toList(OM_DEAD); 93 91 … … 97 95 void AcidSplash::activate() 98 96 { 99 this->unhide(); 97 this->origList = this->getOMListNumber(); 98 this->toList(OM_ENVIRON); 99 // this->unhide(); 100 100 this->grid->setVisibiliy(true); 101 101 … … 110 110 this->lifeCycle = 0.0; 111 111 112 this->hide();112 // this->hide(); 113 113 this->grid->setVisibiliy(false); 114 this->toList(OM_DEAD); 114 this->lifeCycle = 0.0; 115 this->toList(OM_NULL); 116 //this->toList(OM_DEAD); 115 117 this->removeNode(); 116 118 … … 155 157 for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++) 156 158 { 157 if( ((*eIterator)->getOMListNumber() == (this->getOMListNumber()-1)) && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8)159 if( ((*eIterator)->getOMListNumber() != (this->origList -1)) && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8) 158 160 { 159 161 (*eIterator)->hit (this->getDamage(),this); -
branches/playability/src/world_entities/projectiles/hbolt.cc
r10274 r10345 59 59 this->halo->setSize(.65, .65); 60 60 this->halo->setTexture("hbolt_halo2.png"); 61 61 62 } 62 63 … … 84 85 void HBolt::activate() 85 86 { 87 this->origList = this->getOMListNumber(); 86 88 this->toList(OM_ENVIRON); 87 89 if (unlikely(HBolt::explosionParticles == NULL)) … … 144 146 for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++) 145 147 { 146 if( ((*eIterator)->getOMListNumber() == OM_GROUP_00)&& ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8)148 if( ((*eIterator)->getOMListNumber() != (this->origList -1)) && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8) 147 149 { 148 150 (*eIterator)->hit (this->getDamage(),this); -
branches/playability/src/world_entities/projectiles/lbolt.cc
r10274 r10345 61 61 this->halo->setSize(.35, .35); 62 62 this->halo->setTexture("hbolt_halo.png"); 63 64 63 65 } 64 66 … … 86 88 void LBolt::activate() 87 89 { 90 this->origList = this->getOMListNumber(); 88 91 this->toList(OM_ENVIRON); 89 92 if (unlikely(LBolt::explosionParticles == NULL)) … … 143 146 for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++) 144 147 { 145 if( ((*eIterator)->getOMListNumber() == OM_GROUP_00)&& ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8)148 if( ((*eIterator)->getOMListNumber() != (this->origList -1)) && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8) 146 149 { 147 150 (*eIterator)->hit (this->getDamage(),this); -
branches/playability/src/world_entities/projectiles/mbolt.cc
r10274 r10345 81 81 this->trail->setTexture( "maps/laser.png"); 82 82 this->trail->setAbsCoor(this->getAbsCoor() - Vector(.7,0,0)); 83 83 84 } 84 85 … … 107 108 void MBolt::activate() 108 109 { 110 this->origList = this->getOMListNumber(); 109 111 this->toList(OM_ENVIRON); 110 112 if (unlikely(MBolt::explosionParticles == NULL)) … … 137 139 this->lifeCycle = 0.0; 138 140 139 this->toList(OM_DEAD); 141 this->lifeCycle = 0.0; 142 this->toList(OM_NULL); 143 //this->toList(OM_DEAD); 140 144 this->removeNode(); 141 145 MBolt::fastFactory->kill(this); … … 174 178 for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++) 175 179 { 176 if( ((*eIterator)->getOMListNumber() == OM_GROUP_00)&& ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8)180 if( ((*eIterator)->getOMListNumber() != (this->origList -1)) && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8) 177 181 { 178 182 (*eIterator)->hit (this->getDamage(),this); -
branches/playability/src/world_entities/projectiles/projectile.h
r10196 r10345 67 67 protected: 68 68 // energy 69 int origList; //!< FIXME currently a fix around the collision seg fault 69 70 float energyMin; //!< The minimal Energy a Projectile needs to be emitted. 70 71 bool bChargeable; //!< if the Projectile is Charegeable -
branches/playability/src/world_entities/projectiles/spike.cc
r10333 r10345 73 73 // delete Spike::explosionParticles; 74 74 PRINTF(1)("Deleting Spike Particles\n"); 75 /* 76 if (Spike::objectList().exists(Spike::explosionParticles)) 77 delete Spike::explosionParticles; */ 75 78 Spike::explosionParticles = NULL; 76 79 } … … 85 88 { 86 89 Spike::explosionParticles = new SpriteParticles(1000); 87 Spike::explosionParticles->setName(" BoltExplosionParticles");90 Spike::explosionParticles->setName("SpikeExplosionParticles"); 88 91 Spike::explosionParticles->setLifeSpan(.5, .3); 89 92 Spike::explosionParticles->setRadius(0.0, 10.0); … … 103 106 { 104 107 assert (Spike::explosionParticles != NULL); 105 Spike::explosionParticles->removeEmitter(this->emitter); 108 //Spike::explosionParticles->removeEmitter(this->emitter); 109 this->emitter->setSystem(NULL); 106 110 this->lifeCycle = 0.0; 107 111 … … 111 115 } 112 116 113 117 /* 114 118 void Spike::collidesWith(WorldEntity* entity, const Vector& location) 115 119 { … … 120 124 dynamic_cast<SpaceShip*>(entity)->damage(this->getDamage(),0); 121 125 // this->deactivate(); 122 } 126 }*/ 123 127 124 128 /** -
branches/playability/src/world_entities/projectiles/spike.h
r10289 r10345 27 27 virtual void deactivate(); 28 28 29 29 //virtual void collidesWith(WorldEntity* entity, const Vector& location); 30 30 31 31 virtual void destroy (WorldEntity* killer); -
branches/playability/src/world_entities/projectiles/spike_ball.cc
r10333 r10345 82 82 // delete SpikeBall::explosionParticles; 83 83 PRINTF(1)("Deleting SpikeBall Particles\n"); 84 // if (SpikeBall::objectList().exists(SpikeBall::explosionParticles)) 85 // delete SpikeBall::explosionParticles; 84 86 SpikeBall::explosionParticles = NULL; 85 87 } … … 94 96 { 95 97 SpikeBall::explosionParticles = new SpriteParticles(1000); 96 SpikeBall::explosionParticles->setName(" BoltExplosionParticles");98 SpikeBall::explosionParticles->setName("SpikeBallExplosionParticles"); 97 99 SpikeBall::explosionParticles->setLifeSpan(.5, .3); 98 100 SpikeBall::explosionParticles->setRadius(0.0, 10.0); … … 138 140 { 139 141 assert (SpikeBall::explosionParticles != NULL); 140 SpikeBall::explosionParticles->removeEmitter(this->emitter); 142 //SpikeBall::explosionParticles->removeEmitter(this->emitter); 143 this->emitter->setSystem(NULL); 141 144 this->lifeCycle = 0.0; 142 145 … … 146 149 } 147 150 148 151 /* 149 152 void SpikeBall::collidesWith(WorldEntity* entity, const Vector& location) 150 153 { … … 154 157 this->hitEntity = entity; 155 158 dynamic_cast<SpaceShip*>(entity)->damage(this->getDamage(),0); 156 } 159 }*/ 157 160 158 161 -
branches/playability/src/world_entities/projectiles/spike_ball.h
r10333 r10345 32 32 virtual void deactivate(); 33 33 34 virtual void collidesWith(WorldEntity* entity, const Vector& location);34 // virtual void collidesWith(WorldEntity* entity, const Vector& location); 35 35 36 36 virtual void destroy (WorldEntity* killer); -
branches/playability/src/world_entities/projectiles/swarm_projectile.cc
r10271 r10345 62 62 //this->trail->setParent( this); 63 63 this->trail->setTexture( "maps/laser.png"); 64 65 66 this->origList = this->getOMListNumber(); 67 this->toList(OM_ENVIRON); 64 68 } 65 69 … … 190 194 this->deactivate(); 191 195 192 /*193 Vector targetFarFarAway = this->getAbsCoor() + Vector(100000, 0, 0);194 195 {196 speed = velocity.len();197 diffVector = ((targetFarFarAway - this->getAbsCoor()).getNormalized());198 199 if(velocity.dot(diffVector) != 0)200 {201 correctionVector = (( ( diffVector * (speed * speed/( velocity.dot(diffVector ) ) )) - velocity).getNormalized()) * agility;202 203 if( (diffVector * (speed * speed/( velocity.dot(diffVector ) ) ) -velocity).len() < agility )204 velocity = ((diffVector * (speed * speed/( velocity.dot(diffVector ) ) )).getNormalized())*agility;205 else if(velocity.dot(diffVector) > 0)206 velocity += correctionVector;207 else if (velocity.dot(diffVector) < 0)208 velocity -= correctionVector;209 }210 else211 velocity += diffVector * agility;212 213 this->setAbsDir(Quaternion(velocity, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)));214 }215 216 velocity *= maxVelocity/velocity.len();217 Vector v = this->velocity * (time);218 this->shiftCoor(v);*/219 196 220 197 … … 235 212 this->shiftCoor(this->velocity * time); 236 213 237 /*238 239 Vector pjV = this->getVelocity();240 Vector tV = this->target->getVelocity();241 Vector pT = this->target->getAbsCoor() - this->getAbsCoor(); // vector projectile target242 243 Vector a = tV.getNormalized() * pT.dot(tV.getNormalized());244 245 float A = 2 * pT.len() * pT.len();246 float B = 2 * a.len() * a.len();247 float D = 2 * sqrt(B * B - 4 * pT.len() * pT.len() *(tV.len() * tV.len() - pjV.len() * pjV.len()));248 float tti;249 250 if (A != 0){251 if ( B < D ) tti = ( B + D ) / A;252 else tti = ( B + D ) / A;253 }254 else tti = 0;255 256 257 Vector estTargetDir;258 if (tti == 0)259 estTargetDir = pT.getNormalized() * pjV.len();260 else261 estTargetDir = pT / tti + pjV;262 263 this->velocity = this->newDirection(this->velocity, estTargetDir, this->turningSpeed * time );264 265 this->shiftCoor(this->velocity * (this->maxVelocity * time));*/266 267 214 if(this->tickLifeCycle(time)) 268 215 this->deactivate(); … … 276 223 this->lastDir = this->curDir; 277 224 this->curDir = this->velocity; 278 if( (this->getAbsCoor() - this->target->getAbsCoor()).len() < 3) // FIXME Temp fake workaround for collision :) 225 226 if( this->target != NULL && (this->getAbsCoor() - this->target->getAbsCoor()).len() < 3) // FIXME Temp fake workaround for collision :) 279 227 { 280 dynamic_cast<WorldEntity*>(target)-> destroy(this);281 this->de stroy( this);228 dynamic_cast<WorldEntity*>(target)->hit(this->getDamage(), this); 229 this->deactivate(); 282 230 } 283 231 } -
branches/playability/src/world_entities/weapons/acid_launcher.cc
r10333 r10345 84 84 animation2->setInfinity(ANIM_INF_CONSTANT); 85 85 */ 86 this->setStateDuration(WS_SHOOTING, .6); 86 this->setStateDuration(WS_SHOOTING, 1.0f); 87 87 88 this->setStateDuration(WS_RELOADING, 1.0f); 88 89 this->setStateDuration(WS_ACTIVATING, .4); … … 95 96 this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET | WTYPE_DIRECTIONAL | WTYPE_LIGHT); 96 97 this->setProjectileTypeC("AcidSplash"); 97 98 98 // this->loadModel("models/guns/turret1.obj", 1.0); 99 99 100 100 this->setEmissionPoint(2.0, 0, 0); 101 this->getProjectileFactory()->prepare(10 0);101 this->getProjectileFactory()->prepare(10); 102 102 103 103 this->setActionSound(WA_SHOOT, "sound/explosions/explosion_1.wav"); … … 148 148 149 149 Projectile* pj = NULL; 150 for( int i=0; i < 5; i++)150 for( int i=0; i < 1; i++) 151 151 { 152 152 pj = this->getProjectile(); … … 155 155 156 156 fired = true; 157 pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*1 15.0 + VECTOR_RAND(10)));157 pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*165.0 + VECTOR_RAND(10))); 158 158 159 159 pj->setParent(PNode::getNullParent()); -
branches/playability/src/world_entities/weapons/swarm_launcher.cc
r10179 r10345 150 150 for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++) 151 151 { 152 if( ((*eIterator)->getOMListNumber() == OM_GROUP_00) && ((*eIterator)->getClassCName() != "Weapon") && ((*eIterator)->getClassCName() != "Projectile") && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 300)152 if( ((*eIterator)->getOMListNumber() != (this->getOMListNumber() -1)) && ((*eIterator)->getClassCName() != "Weapon") && ((*eIterator)->getClassCName() != "Projectile") && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 300) 153 153 { 154 154 pj = this->getProjectile();
Note: See TracChangeset
for help on using the changeset viewer.