Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3401 in orxonox.OLD for orxonox/branches/dave/src


Ignore:
Timestamp:
Feb 11, 2005, 12:10:00 PM (20 years ago)
Author:
dave
Message:

branches/dave/src:Ok, diesmal ist die Rotation besser gelungen, schoener programmiert und vor allem nur im player.cc und player.h

Location:
orxonox/branches/dave/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/dave/src/Makefile.in

    r3377 r3401  
    1 # Makefile.in generated by automake 1.8.5 from Makefile.am.
     1# Makefile.in generated by automake 1.8.3 from Makefile.am.
    22# @configure_input@
    33
     
    543543        tags=; \
    544544        here=`pwd`; \
    545         if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
     545        if (etags --etags-include --version) >/dev/null 2>&1; then \
    546546          include_option=--etags-include; \
    547           empty_fix=.; \
    548547        else \
    549548          include_option=--include; \
    550           empty_fix=; \
    551549        fi; \
    552550        list='$(SUBDIRS)'; for subdir in $$list; do \
    553551          if test "$$subdir" = .; then :; else \
    554             test ! -f $$subdir/TAGS || \
     552            test -f $$subdir/TAGS && \
    555553              tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
    556554          fi; \
     
    562560          $(AWK) '    { files[$$0] = 1; } \
    563561               END { for (i in files) print i; }'`; \
    564         if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
    565           test -n "$$unique" || unique=$$empty_fix; \
    566           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
    567             $$tags $$unique; \
    568         fi
     562        test -z "$(ETAGS_ARGS)$$tags$$unique" \
     563          || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
     564             $$tags $$unique
    569565ctags: CTAGS
    570566CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
  • orxonox/branches/dave/src/camera.cc

    r3365 r3401  
    171171        {
    172172          //FIXME: camera should be made via relative coordinates
    173           Vector* cameraOffset = new Vector (-10, 5, 0);
     173          Vector* cameraOffset = new Vector (-15,8, 0);
    174174          this->setRelCoor (cameraOffset);
    175175        }
  • orxonox/branches/dave/src/console/Makefile.in

    r3377 r3401  
    1 # Makefile.in generated by automake 1.8.5 from Makefile.am.
     1# Makefile.in generated by automake 1.8.3 from Makefile.am.
    22# @configure_input@
    33
     
    289289          $(AWK) '    { files[$$0] = 1; } \
    290290               END { for (i in files) print i; }'`; \
    291         if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
    292           test -n "$$unique" || unique=$$empty_fix; \
    293           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
    294             $$tags $$unique; \
    295         fi
     291        test -z "$(ETAGS_ARGS)$$tags$$unique" \
     292          || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
     293             $$tags $$unique
    296294ctags: CTAGS
    297295CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
  • orxonox/branches/dave/src/environment.cc

    r3380 r3401  
    5959 
    6060  glMatrixMode(GL_MODELVIEW);
     61  glRotatef(90.0f,0.0f,1.0f,0.0f);
     62  glScalef(.5f,.5f,.5f);
     63 
    6164  this->model->draw();
    6265}
  • orxonox/branches/dave/src/gui/Makefile.in

    r3377 r3401  
    1 # Makefile.in generated by automake 1.8.5 from Makefile.am.
     1# Makefile.in generated by automake 1.8.3 from Makefile.am.
    22# @configure_input@
    33
     
    321321          $(AWK) '    { files[$$0] = 1; } \
    322322               END { for (i in files) print i; }'`; \
    323         if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
    324           test -n "$$unique" || unique=$$empty_fix; \
    325           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
    326             $$tags $$unique; \
    327         fi
     323        test -z "$(ETAGS_ARGS)$$tags$$unique" \
     324          || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
     325             $$tags $$unique
    328326ctags: CTAGS
    329327CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
  • orxonox/branches/dave/src/importer/Makefile.in

    r3377 r3401  
    1 # Makefile.in generated by automake 1.8.5 from Makefile.am.
     1# Makefile.in generated by automake 1.8.3 from Makefile.am.
    22# @configure_input@
    33
     
    303303          $(AWK) '    { files[$$0] = 1; } \
    304304               END { for (i in files) print i; }'`; \
    305         if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
    306           test -n "$$unique" || unique=$$empty_fix; \
    307           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
    308             $$tags $$unique; \
    309         fi
     305        test -z "$(ETAGS_ARGS)$$tags$$unique" \
     306          || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
     307             $$tags $$unique
    310308ctags: CTAGS
    311309CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
  • orxonox/branches/dave/src/player.cc

    r3380 r3401  
    2727{
    2828
    29   this->model = new Model("../data/models/reaplow.obj");
     29  this->model = new Model("../data/models/reaplow.obj",.4f);
    3030  /*
    3131  objectList = glGenLists(1);
     
    6666  bUp = bDown = bLeft = bRight = bAscend = bDescend = false;
    6767  bFire = false;
    68   acceleration = 10.0;
     68  acceleration = 20.0;
    6969  setCollision(new CollisionCluster(1.0, Vector(0,0,0)));
    7070}
     
    103103  glLoadIdentity();
    104104  float matrix[4][4];
    105  
     105  //glRotatef(90.0f,1.0f,0.0f,0.0f);
    106106  /* translate */
    107107  glTranslatef (this->getAbsCoor ().x,
     
    111111  this->getAbsDir ().matrix (matrix);
    112112  glMultMatrixf((float*)matrix);
    113  
     113  glRotatef(angle,1.0f,0.0f,0.0f);
    114114  glMatrixMode(GL_MODELVIEW);
    115115  this->model->draw();
     
    132132void Player::move (float time)
    133133{
     134 
    134135  Vector accel(0.0, 0.0, 0.0);
     136 
    135137  /* FIXME: calculating the direction and orthDirection every timeSlice is redundant! save it somewhere */
    136138  //Placement *pos = getPlacement();
     
    138140  /* calculate the direction in which the craft is heading  */
    139141  Vector direction (1.0, 0.0, 0.0);
     142   
     143 
     144 
    140145  //direction = this->absDirection.apply (direction);
    141146  Vector orthDirection (0.0, 0.0, 1.0);
     147 
    142148  //orthDirection = orthDirection.cross (direction);
    143149
    144   if( bUp) { accel = accel+(direction*acceleration); }
    145   if( bDown) { accel = accel-(direction*acceleration); }
    146   if( bLeft ) { accel = accel - (orthDirection*acceleration); }
    147   if( bRight ) { accel = accel + (orthDirection*acceleration); }
     150  if( bUp) { accel = accel+(direction*acceleration);accelSlipDirection=accel; }
     151  if( bDown) { accel = accel-(direction*acceleration);accelSlipDirection=accel; }
     152  if( bLeft ) { accel = accel-(orthDirection*acceleration);rotate(time);accelSlip=accel; }
     153  if( bRight ) { accel = accel+(orthDirection*acceleration);rotate(time);accelSlip=accel;}
    148154  if( bAscend ) { /* not yet implemented but just: (0,0,1)*acceleration */}
    149155  if( bDescend) {/* FIXME */} /* \todo up and down player movement */
     156  if((int)angle!=0&&!bLeft&&!bRight){backRotate(time);accelSlip=accelSlip-slip(time,accelSlip);}
     157  if(!bUp&&!bDown){accelSlipDirection=accelSlipDirection-slip(time,accelSlipDirection);}
    150158
    151159  //Location* l = getLocation();
     
    159167  //l->dist = l->dist + travelSpeed * time;
    160168 
    161   Vector* shift = new Vector (this->travelSpeed * time, 0, 0);
    162   this->shiftCoor (shift);
     169  //Vector* shift = new Vector (this->travelSpeed * time, 0, 0);
     170  Vector shift(this->travelSpeed*time,0,0);
     171 
     172  this->shiftCoor (&shift);
    163173 
    164174  /* this updates the player position on the track - user interaction */
    165175  //l->pos = l->pos + accel*time;
     176 
    166177  Vector move = accel * time;
    167178  this->shiftCoor (&move);
    168 }
     179 
     180}
     181void Player::rotate(float time){
     182    if(bLeft&&angle>-40.0f){
     183        angle=angle-time*200.0f;
     184               
     185    }
     186    if(bRight&&angle<40.0f){
     187        angle=angle+time*200.0f;
     188               
     189    }
     190}
     191
     192void Player::backRotate(float time){
     193    if(angle<0){
     194    angle=angle+3.0f*(exp(angle*.0015f*time));
     195   
     196   
     197    }
     198    if(angle>0){
     199    angle=angle-3.0f*(exp(-angle*.0015f*time));
     200   
     201   
     202    }
     203
     204}
     205//When the sidewords movement is finished, the ship will still slip untill it stands still
     206Vector Player::slip(float time,Vector accel){
     207        Vector move= accel*time;
     208        this->shiftCoor(&move);
     209        return accel*time*3.0f;
     210   
     211}
     212
     213
     214
     215
     216
  • orxonox/branches/dave/src/player.h

    r3365 r3401  
    3232  virtual void leftWorld();
    3333 
     34 
    3435 private:
    3536  bool bUp, bDown, bLeft, bRight, bAscend, bDescend;
    3637  bool bFire;
     38 
    3739  Vector velocity;
     40  Vector accelSlip;
     41  Vector accelSlipDirection;
    3842  float travelSpeed;
    3943  float acceleration;
     44  float angle;
    4045  GLuint objectList;
    4146 
    4247  void move(float time);
    43  
     48  void rotate(float time);
     49  void backRotate(float time);
     50  Vector slip (float time,Vector accel);
    4451};
    4552
  • orxonox/branches/dave/src/world.cc

    r3370 r3401  
    377377  int sizeZ = 80;
    378378  float length = 1000;
    379   float width = 200;
     379  float width = 300;
    380380  float widthX = float (length /sizeX);
    381381  float widthZ = float (width /sizeZ);
Note: See TracChangeset for help on using the changeset viewer.