Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6255 in orxonox.OLD for branches/spaceshipcontrol


Ignore:
Timestamp:
Dec 21, 2005, 5:31:17 PM (19 years ago)
Author:
snellen
Message:

guiding_misslie.cc updated, targeting_turret added

Location:
branches/spaceshipcontrol/src
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • branches/spaceshipcontrol/src/Makefile.am

    r6222 r6255  
    7171                  world_entities/weapons/ground_turret.cc \
    7272                  world_entities/weapons/aiming_turret.cc \
     73                  world_entities/weapons/targeting_turret.cc \
    7374                  world_entities/weapons/cannon.cc \
    7475                  world_entities/weapons/test_bullet.cc \
     
    120121                 world_entities/weapons/turret.h \
    121122                 world_entities/weapons/aiming_turret.h \
     123                 world_entities/weapons/targeting_turret.h \
    122124                 world_entities/weapons/test_bullet.h \
    123125                 world_entities/weapons/rocket.h \
  • branches/spaceshipcontrol/src/defs/class_id.h

    r6222 r6255  
    161161  CL_AIMING_TURRET              =    0x00000232,
    162162  CL_CANNON                     =    0x00000233,
     163  CL_TARGETING_TURRET           =    0x00000234,
    163164
    164165  CL_TEST_BULLET                =    0x00000240,
  • branches/spaceshipcontrol/src/lib/coord/p_node.cc

    r6142 r6255  
    745745          /* update the current absDirection - remember * means rotation around sth.*/
    746746          this->prevRelCoordinate = this->relCoordinate;
    747           this->absDirection = this->relDirection * parent->getAbsDir();;
     747          this->absDirection = parent->getAbsDir() * this->relDirection;
    748748        }
    749749
  • branches/spaceshipcontrol/src/world_entities/creatures/md2_creature.cc

    r6222 r6255  
    303303  //orient the MD2Creature in direction of the mouse
    304304  this->setAbsDir(mouseDirX);
    305   this->cameraConnNode.setAbsDirSoft(mouseDirX*mouseDirY, 10);
     305  this->cameraConnNode.setRelDir(mouseDirY);
    306306
    307307  this->getWeaponManager()->tick(time);
  • branches/spaceshipcontrol/src/world_entities/space_ships/space_ship.cc

    r6234 r6255  
    286286
    287287  //orient the spaceship in direction of the mouse
    288    rotQuat = Quaternion::quatSlerp( this->getAbsDir(), mouseDir, fabsf(time)*3.0);
     288   rotQuat = Quaternion::quatSlerp( this->getAbsDir(), mouseDir, 1);
    289289   if (this->getAbsDir().distance(rotQuat) > 0.00000000000001)
    290290    this->setAbsDir( rotQuat);
     
    466466    //if (this->getWeaponManager()->hasFreeSlot(3))
    467467    {
    468       turret = new AimingTurret();
     468      turret = dynamic_cast<Weapon*>(Factory::fabricate(CL_TARGETING_TURRET));
     469      if (turret != NULL)
    469470      this->getWeaponManager()->addWeapon(turret, 3);
    470471
  • branches/spaceshipcontrol/src/world_entities/weapons/aiming_turret.cc

    r6074 r6255  
    9090
    9191  this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET);
    92   this->setProjectileType(CL_GUIDED_MISSILE);
     92  this->setProjectileType(CL_ROCKET);
    9393
    9494
     
    142142            /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity());
    143143
    144   pj->setTarget(this->target->getParent());
    145144  pj->setParent(PNode::getNullParent());
    146145  pj->setAbsCoor(this->getEmissionPoint());
  • branches/spaceshipcontrol/src/world_entities/weapons/guided_missile.cc

    r6234 r6255  
    4444  this->energyMax = 10;
    4545  this->lifeSpan = 10.0;
    46   this->agility = 4;
     46  this->agility = 500;
    4747  this->maxVelocity = 75;
    4848
     
    156156     correctionVector = (( ( diffVector *  (speed * speed/( velocity.dot(diffVector ) ) )) - velocity).getNormalized()) * agility;
    157157
    158       if(velocity.dot(diffVector) > 0)
     158      if( (diffVector *  (speed * speed/( velocity.dot(diffVector ) ) ) -velocity).len() < agility )
     159       velocity = ((diffVector *  (speed * speed/( velocity.dot(diffVector ) ) )).getNormalized())*agility;
     160      else if(velocity.dot(diffVector) > 0)
    159161        velocity += correctionVector;
    160162      else if (velocity.dot(diffVector) < 0)
Note: See TracChangeset for help on using the changeset viewer.