Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3172 in orxonox.OLD for orxonox/branches


Ignore:
Timestamp:
Dec 14, 2004, 11:36:07 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/dave: (commit from dave) now the fighter banks while moving. really cool stuff

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

Legend:

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

    r3151 r3172  
    3838PRE_UNINSTALL = :
    3939POST_UNINSTALL = :
    40 host_triplet = @host@
    4140bin_PROGRAMS = orxonox$(EXEEXT)
    4241subdir = src
     
    114113EGREP = @EGREP@
    115114EXEEXT = @EXEEXT@
    116 GTK2_CFLAGS = @GTK2_CFLAGS@
    117 GTK2_LIBS = @GTK2_LIBS@
    118 HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    119 HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
    120115INSTALL_DATA = @INSTALL_DATA@
    121116INSTALL_PROGRAM = @INSTALL_PROGRAM@
     
    151146am__quote = @am__quote@
    152147bindir = @bindir@
    153 build = @build@
    154148build_alias = @build_alias@
    155 build_cpu = @build_cpu@
    156 build_os = @build_os@
    157 build_vendor = @build_vendor@
    158149datadir = @datadir@
    159150exec_prefix = @exec_prefix@
    160 host = @host@
    161151host_alias = @host_alias@
    162 host_cpu = @host_cpu@
    163 host_os = @host_os@
    164 host_vendor = @host_vendor@
    165152includedir = @includedir@
    166153infodir = @infodir@
     
    177164sharedstatedir = @sharedstatedir@
    178165sysconfdir = @sysconfdir@
    179 target = @target@
    180166target_alias = @target_alias@
    181 target_cpu = @target_cpu@
    182 target_os = @target_os@
    183 target_vendor = @target_vendor@
    184167AM_CXXFLAGS = "-I/usr/X11R6/include"
    185168AM_LDFLAGS = "-L/usr/Mesa-6.0.1/lib  -L/usr/X11R6/lib -lXt -lX11" $(MWINDOWS)
    186 orxonox_SOURCES = orxonox.cc world.cc player.cc data_tank.cc world_entity.cc vector.cc camera.cc collision.cc command_node.cc ini_parser.cc keynames.cc track.cc base_entity.cc game_loader.cc campaign.cc story_entity.cc object.cc environment.cc array.cc material.cc list.cc
     169orxonox_SOURCES = orxonox.cc world.cc player.cc data_tank.cc world_entity.cc vector.cc camera.cc collision.cc command_node.cc ini_parser.cc keynames.cc track.cc base_entity.cc game_loader.cc campaign.cc story_entity.cc object.cc environment.cc array.cc material.cc list.cc 
    187170noinst_HEADERS = ability.h data_tank.h npc.h stdincl.h ai.h environment.h orxonox.h synchronisable.h base_entity.h error.h player.h track.h camera.h ini_parser.h power_up.h vector.h collision.h keynames.h proto_class.h world.h command_node.h list.h shoot_laser.h world_entity.h coordinates.h message_structures.h shoot_rocket.h object.h array.h material.h list_template.h story_entity.h story_def.h game_loader.h campaign.h
    188171all: all-am
  • orxonox/branches/dave/src/command_node.cc

    r3155 r3172  
    3737  netID = ID;
    3838  bLocalInput = false;
     39 
    3940}
    4041
     
    172173  SDL_Event event;
    173174  Command cmd;
     175 
    174176 
    175177  while( SDL_PollEvent (&event))
     
    181183          strcpy (cmd.cmd, aliases->keys[event.key.keysym.sym]);
    182184          cmd.bUp = false;
     185         
     186         
    183187          if( strlen (cmd.cmd) > 0) relay (&cmd);
    184188          break;
     
    186190          strcpy( cmd.cmd, aliases->keys[event.key.keysym.sym]);
    187191          cmd.bUp = true;
    188           cmd.tottime=0.0f;
    189192         
     193         
    190194          if( strlen (cmd.cmd) > 0) relay (&cmd);
    191195          break;
  • orxonox/branches/dave/src/message_structures.h

    r3155 r3172  
    1212typedef struct
    1313{       float tottime;
     14        float rottime;
     15        float angle;
     16        bool angleturn;
     17       
     18       
    1419        char cmd[CMD_LENGHT];   //!< the command delivered
    1520        bool bUp;       //!< false = command was activated / true = command was deactivated
  • orxonox/branches/dave/src/player.cc

    r3155 r3172  
    2929  obj = new Object ("reaplow.obj");
    3030  tottime=0.0f;
     31  movfinishright=movfinishleft=movfinishup=movfinishdown=false;
     32  angleturn=false;
    3133 
    3234  /*
     
    9395{
    9496  //printf("Player|recieved command [%s]\n", cmd->cmd);
     97 
    9598  tottime=cmd->tottime;
     99  rottime=cmd->rottime;
     100  angleturn=cmd->angleturn;
     101 
     102 
    96103  if( !strcmp( cmd->cmd, "up")) bUp = !cmd->bUp;
    97104  else if( !strcmp( cmd->cmd, "down")) bDown = !cmd->bUp;
     
    106113  glLoadIdentity();
    107114  float matrix[4][4];
    108  
     115  float a[3];
     116  a[0]=.8f;
     117  a[1]=.8f;
     118  a[2]=.8f;
     119  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
    109120  glTranslatef(get_placement()->r.x,get_placement()->r.y,get_placement()->r.z);
    110121  get_placement()->w.matrix (matrix);
    111122  glMultMatrixf ((float*)matrix);
    112   
     123 
    113124  glMatrixMode (GL_MODELVIEW);
     125  glRotatef (angle,0,0,1);
    114126  glRotatef (-90, 0,1,0);
     127 
    115128  obj->draw();
    116129  //  glCallList (objectList);
     
    141154  Vector orthDirection(0.0, 0.0, 1.0);
    142155  orthDirection = orthDirection.cross(direction);
     156 
     157  if(rottime<1.0f)
     158          rottime=rottime+2.5f*time;
     159  else
     160          rottime=1.0f;
    143161  if(tottime<1.5f)
    144162          tottime=tottime+4.0f*time;
    145163  else
    146164          tottime=1.5f;
    147   if( bUp) { accel = accel+(direction*acceleration*pow(tottime,2.0f)); }
    148   if( bDown) { accel = accel-(direction*acceleration*pow(tottime,2.0f)); }
    149   if( bLeft ) { accel = accel + (orthDirection*acceleration*pow(tottime,2.0f)); }
    150   if( bRight ) { accel = accel - (orthDirection*acceleration*pow(tottime,2.0f));}
     165 
     166  //Langsam zurückdrehen    ->anlgeturn ist für das Zurückdrehen verantwortlich!
     167  if((angleturn||bLeft&&bRight)&&angle<=0.0f){
     168          if(!bLeft)
     169          angle=angle+rottime*10.0f;
     170          if(angle>0.0f){
     171                 
     172                  angleturn=false;
     173                  angle=0.0f;}
     174          }
     175 
     176  if((angleturn||bLeft&&bRight)&&angle>=0.0f){
     177          if(!bRight)
     178          angle=angle-rottime*10.0f;
     179          if(angle<0.0f){
     180                  angleturn=false;
     181                  angle=0.0f;}
     182                }
     183  //Bewegung lansam abbremsen    **************
     184  if(movfinishleft&&!bLeft){
     185          accel=accel+(orthDirection*acceleration*(tottimecopy-pow(tottime,1.5f)+.5f));
     186          if(tottime>tottimecopy)
     187                  movfinishleft=false;
     188  }
     189  if(movfinishright&&!bRight){
     190        accel=accel-(orthDirection*acceleration*(tottimecopy-pow(tottime,1.5f)+.5f));
     191        if(tottime>tottimecopy)
     192                movfinishright=false;
     193  }
     194  if(movfinishup&&!bUp){
     195        accel=accel+(direction*acceleration*(tottimecopy-pow(tottime,1.5f)+.5f));
     196        if(tottime>tottimecopy)
     197                movfinishup=false;
     198  }
     199 
     200  if(movfinishdown&&!bDown){
     201        accel=accel-(direction*acceleration*(tottimecopy-pow(tottime,1.5f)+.5f));
     202        if(tottime>tottimecopy)
     203                movfinishdown=false;
     204  } 
     205  //                            **************
     206 
     207  if( bUp) { accel = accel+(direction*acceleration*pow(tottime,2.0f));movfinishup=true;tottimecopy=tottime;}
     208  if( bDown) { accel = accel-(direction*acceleration*pow(tottime,2.0f));movfinishdown=true;tottimecopy=tottime; }
     209  if( bLeft ) { accel = accel + (orthDirection*acceleration*pow(tottime,2.0f));
     210        if(angle>-40.0f){
     211          angle=angle-rottime*40.0f;}
     212        movfinishleft=true;
     213        tottimecopy=tottime;}
     214  if( bRight ) { accel = accel - (orthDirection*acceleration*pow(tottime,2.0f));
     215        if(angle<40.0f){
     216          angle=angle+rottime*40.0f;}
     217          movfinishright=true;
     218          tottimecopy=tottime;
     219  }
    151220  if( bAscend ) { /* not yet implemented but just: (0,0,1)*acceleration */}
    152221  if( bDescend) {/* FIXME */}
  • orxonox/branches/dave/src/player.h

    r3155 r3172  
    4141  Object* obj;
    4242  float tottime;
     43  float tottimecopy;
     44  float rottime;
     45  float angle;
     46  bool angleturn;
     47  bool movfinishright,movfinishleft,movfinishup,movfinishdown;
     48
     49
    4350 
    4451  void move (float time);
Note: See TracChangeset for help on using the changeset viewer.