Changeset 10132 in orxonox.OLD for branches/playability/src/world_entities
- Timestamp:
- Dec 20, 2006, 5:36:18 PM (18 years ago)
- Location:
- branches/playability/src/world_entities
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/effects/trail.cc
r10107 r10132 100 100 for( int i = 1; i < sections; i++) 101 101 { 102 this->nodeList[i] = (this->getAbsCoor() - (((this->getParent()->getAbsDir().apply(Vector(1,1,1))).getNormalized() * (i * this->maxLength / sections))));102 this->nodeList[i] = (this->getAbsCoor());// - (((this->getParent()->getAbsDir().apply(Vector(1,1,1))).getNormalized() * (i * this->maxLength / sections)))); 103 103 //PRINTF(0)(" N%i (%f,%f,%f)",i,this->nodeList[i].x,this->nodeList[i].y,this->nodeList[i].z); 104 104 } … … 133 133 { 134 134 // Update node positions 135 float len = 0; 135 136 float secLen = this->maxLength / this->sections; 136 this->nodeList[0] = (this->getAbsCoor()); 137 for(int i = 1; i < this->sections; i++) 138 { 139 this->nodeList[i] = this->nodeList[i-1] - (this->nodeList[i-1] - this->nodeList[i]).getNormalized()*secLen; 140 } 141 /* 142 this->length = this->maxLength / (this->getAbsCoor() - this->nodeList[this->sections-1]).len(); 143 if (!likely(this->length == 1.0)) 144 for(int i = 1; i < this->sections; i++) 145 this->nodeList[i] = this->getAbsCoor()- (this->getAbsCoor() - this->nodeList[i])*this->length; 146 */ 147 /*PRINTF(0)("TRAIL POS "); 148 for( int i=0; i < this->sections; i++) 149 { 150 PRINTF(0)("N%i (%f,%f,%f)",i,this->nodeList[i].x,this->nodeList[i].y,this->nodeList[i].z); 151 } 152 PRINTF(0)("\n");*/ 137 this->nodeList[0] = this->getAbsCoor(); 138 this->nodeList[1] = this->getAbsCoor() - ((this->getParent()->getAbsDir().apply(Vector(1,0,0))).getNormalized() * this->maxLength / sections); 139 for(int i = 2; i < this->sections; i++) 140 { 141 len = (this->nodeList[i-1] - this->nodeList[i]).len(); 142 if( secLen < len) len = secLen; 143 this->nodeList[i] = this->nodeList[i-1] - (this->nodeList[i-1] - this->nodeList[i]).getNormalized()*len; 144 } 153 145 } 154 146 -
branches/playability/src/world_entities/projectiles/mbolt.cc
r10117 r10132 78 78 this->buildObbTree(4); 79 79 80 this->trail = new Trail(6, 4,.1, this);80 this->trail = new Trail(6, 4, .1, this); 81 81 //this->trail->setParent( this); 82 82 this->trail->setTexture( "maps/laser.png"); … … 124 124 this->setHealth(0); 125 125 126 127 126 this->emitter->setSpread(0); 128 127 this->emitter->setEmissionRate(10.0); … … 150 149 this->hitEntity = entity; 151 150 dynamic_cast<SpaceShip*>(entity)->damage(this->getPhysDamage(),this->getElecDamage()); 152 this->destroy(this); 151 //this->destroy(this); 152 this->deactivate(); 153 153 154 154 return; 155 155 156 if( entity == NULL || dynamic_cast<SpaceShip*>(entity) == NULL) 157 return; 158 159 dynamic_cast<SpaceShip*>(entity)->damage( this->getPhysDamage(), this->getElecDamage()); 156 //dynamic_cast<SpaceShip*>(entity)->damage( this->getPhysDamage(), this->getElecDamage()); 160 157 //entity->destroy(this); 161 158 //this->deactivate(); -
branches/playability/src/world_entities/projectiles/swarm_projectile.cc
r10117 r10132 55 55 this->emitter->setSpread(M_PI, M_PI); 56 56 57 this->turningSpeed = 30;57 this->turningSpeed = 10; 58 58 59 59 this->physDamage = 200; … … 164 164 // printf("turning angle: %f\ntemp: %f\n", angle, tmp); 165 165 166 if( fabsf(angle) > fabsf(tmp) ) { angle = tmp; } 166 if( fabsf(angle) > fabsf(tmp) ) 167 angle = tmp; 168 else 169 angle *= tmp/fabsf(tmp); 167 170 168 171 Vector d = curDirection.cross(estTargetDir).cross(curDirection); 169 172 d.normalize(); 170 if( unlikely( angle== 90)) { return d; } //avoid complication173 if( unlikely( fabsf(angle) == 90)) { return d; } //avoid complication 171 174 172 175 Vector newDir = curDirection + d * curDirection.len() * tan (angle); … … 221 224 // else 222 225 // tti = (this->getAbsCoor() - this->target->getAbsCoor()).len() / sqrt ( projectileVelocity * projectileVelocity + targetVelocity * targetVelocity); 223 Vector estTargetDir = (this->target->getAbsCoor() - this->getAbsCoor()) ;226 Vector estTargetDir = (this->target->getAbsCoor() - this->getAbsCoor()).getNormalized(); 224 227 // estTargetDir.slerpTo(this->velocity, 1); 225 228 this->velocity = this->newDirection(this->velocity, estTargetDir, this->turningSpeed * time ); … … 275 278 glPushMatrix(); 276 279 277 Vector tmpDir = this->curDir *.7 + this->lastDir * .3; 280 Vector tmpDir = this->curDir; // *.7 + this->lastDir * .3; 281 tmpDir.slerpTo(this->lastDir, .4); 278 282 279 283 float matrix[4][4]; -
branches/playability/src/world_entities/projectiles/swarm_projectile.h
r10087 r10132 50 50 Vector curDir; 51 51 Vector lastDir; 52 Vector oldPos; 52 53 53 54 WorldEntity* hitEntity; // FIXME TEMPORARY -
branches/playability/src/world_entities/space_ships/space_ship.cc
r10121 r10132 343 343 344 344 345 this->trail = new Trail( 10, 10, .2, this);345 this->trail = new Trail( 30, 100, .2, this); 346 346 //this->trail->setParent( this); 347 347 this->trail->setTexture( "maps/engine.png"); 348 348 349 this->trailL = new Trail( 10, 10, .2, this);349 this->trailL = new Trail( 30, 100, .2, this); 350 350 //this->trailL->setParent( this); 351 351 this->trailL->setTexture( "maps/engine.png"); 352 352 353 this->trailR = new Trail( 10, 10, .2, this);353 this->trailR = new Trail( 30, 100, .2, this); 354 354 //this->trailR->setParent( this); 355 355 this->trailR->setTexture( "maps/engine.png"); -
branches/playability/src/world_entities/weapons/medium_blaster.cc
r10121 r10132 56 56 57 57 this->setStateDuration(WS_RELOADING, 0); 58 this->setStateDuration(WS_ACTIVATING, 0); //.5);59 this->setStateDuration(WS_DEACTIVATING, 0); // 1);58 this->setStateDuration(WS_ACTIVATING, .5); //.5); 59 this->setStateDuration(WS_DEACTIVATING, 1); // 1); 60 60 61 61 this->setEnergyMax(500); -
branches/playability/src/world_entities/weapons/weapon_manager.cc
r10121 r10132 435 435 { 436 436 firingWeapon = this->currentSlotConfig[i].currentWeapon; 437 if( firingWeapon != NULL && firingWeapon->getCurrentState() == WS_SHOOTING) continue; 437 438 if( firingWeapon != NULL) firingWeapon->requestAction(WA_SHOOT); 438 439 }
Note: See TracChangeset
for help on using the changeset viewer.