Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10714 in orxonox.OLD for branches/presentation/src


Ignore:
Timestamp:
Jun 18, 2007, 3:19:15 PM (17 years ago)
Author:
nicolasc
Message:

initial upload form mouse aiming in VS

Location:
branches/presentation/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/ai/attack_module.cc

    r10527 r10714  
    7676        //float vMax=1000.0f/myRadius;
    7777        float vMax=maxSpeed;
    78         float aMax=1000/myRadius;
     78//      float aMax=1000/myRadius;
    7979
    8080        //anti player collision
  • branches/presentation/src/lib/graphics/importer/static_model.cc

    r10551 r10714  
    8282void StaticModel::finalize()
    8383{
     84  this->extractMountPoints();
    8485  data->finalize();
    8586  this->updateBase();
     
    100101void StaticModel::extractMountPoints()
    101102{
    102 
     103  printf("extracting MP...");
    103104  // go through all groups and check if they are mounts
    104   std::vector<StaticModelData::Group>::const_iterator groupIt = this->data->getGroups().begin();
    105   for( ; groupIt != this->data->getGroups().end(); groupIt++)
     105  std::vector<StaticModelData::Group>::iterator groupIt = this->data->getGroups().begin();
     106  for( ; groupIt != this->data->getGroups().end();)
    106107  {
    107108    //PRINTF(0)("Found a MountPoint: %s\n", groupName.c_str());
     
    112113
    113114    // check if the name has a "MP" prefix or else it won't work
    114     if( groupName.find("MP.", 0) == std::string::npos)
     115    if( groupName.find("MP.", 0) == std::string::npos){
     116      groupIt++;
     117//       printf("Found MP:  ");
    115118      continue;
    116 
     119    }
    117120
    118121    PRINTF(5)("Found a MountPoint: %s\n", groupName.c_str());
     
    125128      PRINTF(4)("the face count of %s is wrong, perhaps you missnamed this object or used the wrong mount point object (got %i faces)\n",
    126129                groupName.c_str(), (*groupIt)._faces.size());
     130//       printf("wrong number of faces\n\n");
     131      groupIt++;
     132      continue;
    127133    }
    128134
     
    137143    }
    138144
     145//     printf("confirmed  ");
    139146
    140147    Vector center;
     
    143150    Vector zAxis;
    144151    // now process all points
     152//     printf("entering loop: ");
    145153    for( int i = 0; i < 3; i++)
    146154    {
     155//       printf("%i ", i);
    147156      // convert the float vertices to vectors
    148157      Vector a( this->data->getVertices()[triangle[i]._elements[0].vertexNumber * 3],
    149158                this->data->getVertices()[triangle[i]._elements[0].vertexNumber * 3 + 1],
    150159                this->data->getVertices()[triangle[i]._elements[0].vertexNumber * 3 + 2]);
     160//       printf("a");
    151161      Vector b( this->data->getVertices()[triangle[i]._elements[1].vertexNumber * 3],
    152162                this->data->getVertices()[triangle[i]._elements[1].vertexNumber * 3 + 1],
    153163                this->data->getVertices()[triangle[i]._elements[1].vertexNumber * 3 + 2]);
     164//       printf("b");
    154165      Vector c( this->data->getVertices()[triangle[i]._elements[2].vertexNumber * 3],
    155166                this->data->getVertices()[triangle[i]._elements[2].vertexNumber * 3 + 1],
    156167                this->data->getVertices()[triangle[i]._elements[2].vertexNumber * 3 + 2]);
     168//       printf("c  ");
    157169
    158170      Vector ab = a - b;
     
    208220    }
    209221
     222//     printf("adding MP\n");
    210223    // now add the mount point
    211224     this->addMountPoint( zAxis, yAxis, center, groupName);
     225
     226//     printf("removing item...");
     227    // remove the group from the model list (mount points do not need to be drawn)
     228//      std::vector<StaticModelData::Group>::iterator tmpIt =  groupIt;
     229     groupIt++;
     230//     printf("   removing...");
     231//      this->data->getGroups().erase(tmpIt);
     232//     printf("   REMOVED\n");
    212233  }
     234//   printf("done\n");
    213235}
    214236
  • branches/presentation/src/lib/graphics/importer/static_model_data.h

    r10161 r10714  
    129129  ///! HACK SOLUTION sTriangleExt should be const in the modelInfo.
    130130  sTriangleExt* getTrianglesExt() { return &this->triangles[0]; };
    131   const std::vector<Group>& getGroups() { return this->_modelGroups; }
     131  std::vector<Group>& getGroups() { return this->_modelGroups; }
    132132
    133133  float getScaleFactor() const  { return scaleFactor; }
  • branches/presentation/src/world_entities/creatures/fps_player.cc

    r10711 r10714  
    304304//      this->weaponMan.setRelCoor(0, box->halfLength[1] * f, 0);
    305305//      this->cameraNode.setRelCoor(10, box->halfLength[1] * f, 0);
    306      float v = 0.1f;
     306//      float v = 0.1f; // unused variable
    307307     //this->getWeaponManager().setSlotPosition(0, Vector(-8.0, box->halfLength[1] * v, 1.1));
    308308     //this->getWeaponManager().setSlotPosition(1, Vector(5.0, box->halfLength[1] * v, 0.0));
  • branches/presentation/src/world_entities/space_ships/space_ship.cc

    r10698 r10714  
    274274  registerVar( new SynchronizeableBool( &bFire, &bFire, "bSecFire", PERMISSION_OWNER));
    275275  registerVar( new SynchronizeableVector( &velocity, &velocity, "velocity", PERMISSION_MASTER_SERVER ) );
     276//   registerVar( new SynchronizeableQuaternion( &mouseDir, &mouseDir, "mousedir", PERMISSION_OWNER ) );
    276277
    277278  //this->airFriction = 0.5f;
     
    554555void SpaceShip::process(const Event &event)
    555556{
    556   //Playable::process(event);
     557//   Playable::process(event);
    557558
    558559  if( event.type == KeyMapper::PEV_LEFT)
     
    572573  else if( event.type == KeyMapper::PEV_FIRE2)
    573574    this->bSecFire = event.bPressed;
    574   else if( event.type == KeyMapper::PEV_FIRE1)
     575  else if( event.type == KeyMapper::PEV_FIRE1){
     576    printf("fireing primary");
    575577    this->bFire = event.bPressed;
     578  }
    576579  else if( event.type == KeyMapper::PEV_NEXT_WEAPON && event.bPressed)
    577580  {
     
    580583  else if ( event.type == KeyMapper::PEV_PREVIOUS_WEAPON && event.bPressed)
    581584    this->previousWeaponConfig();
    582 
    583   if (!(State::getCamera()->getEventHandling()))
     585  else if( event.type == EV_MOUSE_MOTION)
     586  {
     587//     printf("Spaceship Mouse Motion Event\n");
     588//     dynamic_cast<Crosshair*>(this->weaponMan.getFixedTarget())->process(event);
     589//     this->weaponMan.process(event);
     590    this->xMouse += event.xRel;
     591    this->yMouse += event.yRel;
     592//     printf("Mouse Coord: %f, %f\n", this->xMouse, this->yMouse);
     593    this->weaponMan.getFixedTarget()->setRelCoor(10000, 4*xMouse, 4*yMouse);
     594  }
     595  else if (!(State::getCamera()->getEventHandling()))
    584596  {
    585597    //PRINTF(0)("\n\n\n\n\n\n\n\nSETCAMERA %x\n\n\n\n\n\n\n", State::getCamera());
     
    622634  }
    623635
    624 
    625   /*
    626   else if( event.type == EV_MOUSE_MOTION)
    627   {
    628 
    629     this->xMouse += event.xRel;
    630     this->yMouse += event.yRel;
    631   }
    632   */
    633636}
    634637
     
    821824        State::getCamera()->setEventHandling(false);
    822825
    823         PRINTF(0)("\n\n\n\n\n\n\n\nSETCAMERA %x\n\n\n\n\n\n\n", State::getCamera());
     826        PRINTF(0)("SETCAMERA %x\n", State::getCamera());
    824827        State::getCamera()->setViewMode(Camera::ViewNormal);
    825828        State::getCameraTargetNode()->setParent(this);
  • branches/presentation/src/world_entities/space_ships/space_ship.h

    r10698 r10714  
    168168    bool                  bInit;              //!< set true, if MP have been loaded
    169169
    170     /*
     170
    171171    float                 xMouse;             //!< mouse moved in x-Direction
    172172    float                 yMouse;             //!< mouse moved in y-Direction
    173173    float                 mouseSensitivity;   //!< the mouse sensitivity
    174     int                   yInvert;
    175     int                   controlVelocityX;
    176     int                   controlVelocityY;
    177     */
     174//     int                   yInvert;
     175//     int                   controlVelocityX;
     176//     int                   controlVelocityY;
     177
    178178
    179179    Vector                velocity;           //!< the velocity of the player.
     
    199199    void                  setCameraFovy(float fovy);
    200200
    201     /*
     201
    202202    Quaternion            mouseDir;           //!< the direction where the player wants to fly
    203     Quaternion            oldMouseDir;        //!< the direction where the player wanted to fly
     203    /*Quaternion            oldMouseDir;        //!< the direction where the player wanted to fly
    204204    float                 shipInertia;        //!< the inertia of the ship(how fast the ship reacts to a mouse input)
    205205    Quaternion            rotQuat;
  • branches/presentation/src/world_entities/weapons/crosshair.cc

    r10317 r10714  
    115115  if  (event.type == EV_MOUSE_MOTION)
    116116  {
    117     //this->setAbsCoor2D(event.x, event.y);
     117    printf("Processing Crosshair Mouse Event\n");
     118    this->setAbsCoor2D(event.x, event.y);
    118119  }
    119120}
  • branches/presentation/src/world_entities/weapons/rf_cannon.cc

    r10702 r10714  
    138138
    139139  pj->setAbsCoor(this->emissionPoint[this->activeBarrel]->getAbsCoor());
    140   pj->setAbsDir(this->getAbsDir());
     140//   pj->setAbsDir(this->getAbsDir());
     141//   pj->setAbsDir(Quaternion(0, dynamic_cast<WeaponManager*>(this->getParent())->getFixedTarget()->getAbsCoor() - this->getParent()->getAbsCoor()));
    141142  pj->activate();
    142143
  • branches/presentation/src/world_entities/weapons/weapon_manager.cc

    r10698 r10714  
    630630}
    631631
    632 
     632/**
     633 * processes the input
     634 * @param event the Event coming as input
     635 */
     636// void WeaponManager::process(const Event &event)
     637// {
     638//   if  (event.type == EV_MOUSE_MOTION)
     639//   {
     640//     this->crosshair->process(event);
     641// //     this->setAbsCoor2D(event.x, event.y);
     642//   }
     643// }
  • branches/presentation/src/world_entities/weapons/weapon_manager.h

    r10698 r10714  
    5555    void hideCrosshair();
    5656    void setRotationSpeed(float speed);
     57//     Crosshair* getCrosshair() {return this->crosshair; };
     58
     59//     virtual void process(const Event &event);
    5760
    5861    void setSlotCount(unsigned int slotCount);
  • branches/presentation/src/world_entities/world_entity.cc

    r10710 r10714  
    347347
    348348  // extract the mount points
     349  // Patrick: they get extracted automaticaly now within the model finalization process
     350  /*
     351
    349352  if(model != NULL)
    350353    model->extractMountPoints();
     
    353356    PRINTF(0)("Worldentity %s has no mount points", (this->getName()).c_str());
    354357    return;
    355   }
     358  }*/
    356359
    357360  // first get all mount points from the model
Note: See TracChangeset for help on using the changeset viewer.