Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jan 28, 2006, 12:40:08 PM (19 years ago)
Author:
bensch
Message:

trunk: hover-rotors

Location:
trunk/src/world_entities/space_ships
Files:
2 edited

Legend:

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

    r6805 r6806  
    110110  controlVelocityX = 100;
    111111  controlVelocityY = 100;
    112   //rotorspeed = 1;
    113   //tailrotorspeed = 0;
    114 
    115   //cycle = 0.0;
    116 
    117   // cameraissue
     112
     113  this->rotorSpeed = 1000.0f;
     114  this->rotorCycle = 0.0f;
     115
     116  // camera - issue
    118117  this->cameraNode.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
     118  this->cameraNode.addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE);
    119119  this->cameraNode.setParent(this);
    120   this->cameraNode.setParentMode(PNODE_ALL);
    121 
    122120
    123121  // rotors
     
    142140  this->loadModel("models/ships/hoverglider_wing.obj", 1.0f, 3);
    143141  this->loadModel("models/ships/hoverglider_rotor.obj", 1.0f, 4);
     142  this->loadModel("models/ships/rotor.obj", .45f, 5);
    144143
    145144  //add events to the eventlist
     
    258257  // spaceship controlled movement
    259258  this->movement(dt);
     259  this->rotorCycle += this->rotorSpeed * dt;
    260260
    261261  Vector move = (velocity)*dt;
     
    271271 * @param time the timeslice since the last frame
    272272*/
    273 void Hover::movement (float time)
     273void Hover::movement (float dt)
    274274{
    275275  Vector accel(0.0, 0.0, 0.0);
     
    330330  glRotatef (this->rotorNodeLeft.getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    331331  this->getModel(4)->draw();
     332  glTranslatef(0,-1,0);
     333  glRotatef(this->rotorCycle, 0,1,0);
     334  this->getModel(5)->draw();
    332335  glPopMatrix ();
    333336
     
    351354  glScalef(1,1,-1);
    352355  this->getModel(4)->draw();
     356  glTranslatef(0,-1,0);
     357  glRotatef(this->rotorCycle, 0,1,0);
     358  this->getModel(5)->draw();
    353359  glPopMatrix ();
    354360}
  • trunk/src/world_entities/space_ships/hover.h

    r6805 r6806  
    2828
    2929    virtual void collidesWith(WorldEntity* entity, const Vector& location);
    30     virtual void tick(float time);
     30    virtual void tick(float dt);
    3131    virtual void draw() const;
    3232
     
    3535  private:
    3636    void init();
    37     void movement(float time);
     37    void movement(float dt);
    3838
    3939  private:
     
    6464    float                 travelSpeed;        //!< the current speed of the Hove (to make soft movement)
    6565    float                 acceleration;       //!< the acceleration of the Hover.
    66     //float                 rotorspeed;         //!< the speed of the rotor.
    67     //float                 tailrotorspeed;     //!< the relativ speed ot the tail rotor
     66
     67    float                 rotorSpeed;         //!< the speed of the rotor.
     68    float                 rotorCycle;         //!< The Cycle the rotor is in.
    6869
    6970    float                 airViscosity;
Note: See TracChangeset for help on using the changeset viewer.