Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6880 in orxonox.OLD for trunk/src/world_entities/space_ships


Ignore:
Timestamp:
Jan 31, 2006, 2:27:02 AM (19 years ago)
Author:
bensch
Message:

trunk: in 3d

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/space_ships/hover.cc

    r6879 r6880  
    115115  this->cameraNode.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
    116116  this->cameraNode.addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE);
     117  //this->cameraNode.setParentMode(PNODE_ROTATE_MOVEMENT);
    117118  this->cameraNode.setParent(this);
    118119
     
    142143  registerEvent(KeyMapper::PEV_LEFT);
    143144  registerEvent(KeyMapper::PEV_RIGHT);
    144   //registerEvent(SDLK_q);
    145   registerEvent(SDLK_e);
    146   registerEvent(SDLK_c);
     145  registerEvent(SDLK_e); /// FIXME
     146  registerEvent(SDLK_c); /// FIXME
    147147  registerEvent(KeyMapper::PEV_FIRE1);
    148148  registerEvent(KeyMapper::PEV_NEXT_WEAPON);
    149149  registerEvent(KeyMapper::PEV_PREVIOUS_WEAPON);
    150   //registerEvent(SDLK_PAGEUP);
    151   //registerEvent(SDLK_PAGEDOWN);
    152150  registerEvent(EV_MOUSE_MOTION);
    153151
     
    280278
    281279  Vector tmp = this->getAbsDir().apply(accel * 500.0);
    282   tmp.y = accel.y * 500.0 ;
     280  //tmp.y = accel.y * 500.0 ;
    283281  velocity += tmp * dt;
    284282
     
    290288  this->rotation = 0.0f;
    291289
    292   accel *=.5;
    293   this->setRelDirSoft(this->direction * Quaternion(-accel.x, Vector(0,0,1)) * Quaternion(accel.z, Vector(1,0,0)), 5);
     290  this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5);
    294291
    295292  this->wingNodeLeft.setRelDirSoft(Quaternion(accel.z+this->rotation, Vector(1,0,0)), 5);
    296   this->rotorNodeLeft.setRelDirSoft(Quaternion(-2.0*accel.x+this->rotation, Vector(0,0,1)), 5);
     293  this->rotorNodeLeft.setRelDirSoft(Quaternion(-2.0*accel.x+this->rotation + cameraLook, Vector(0,0,1)), 5);
    297294
    298295  this->wingNodeRight.setRelDirSoft(Quaternion(accel.z+this->rotation, Vector(1,0,0)), 5);
    299   this->rotorNodeRight.setRelDirSoft(Quaternion(-2.0*accel.x-this->rotation, Vector(0,0,1)), 5);
     296  this->rotorNodeRight.setRelDirSoft(Quaternion(-2.0*accel.x-this->rotation + cameraLook, Vector(0,0,1)), 5);
    300297}
    301298
     
    386383    if (cameraLook > M_PI_4)
    387384      cameraLook = M_PI_4;
    388     else if (cameraLook < -M_PI_2)
    389       cameraLook = -M_PI_2;
    390     this->cameraNode.setRelDirSoft(Quaternion(-cameraLook, Vector(0,0,1)),10);
    391   }
    392 }
     385    else if (cameraLook < -M_PI_4)
     386      cameraLook = -M_PI_4;
     387    //this->cameraNode.setRelDirSoft(this->direction,10);
     388  }
     389}
Note: See TracChangeset for help on using the changeset viewer.