Changeset 3172 in orxonox.OLD for orxonox/branches
- Timestamp:
- Dec 14, 2004, 11:36:07 PM (20 years ago)
- Location:
- orxonox/branches/dave/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/dave/src/Makefile.in
r3151 r3172 38 38 PRE_UNINSTALL = : 39 39 POST_UNINSTALL = : 40 host_triplet = @host@41 40 bin_PROGRAMS = orxonox$(EXEEXT) 42 41 subdir = src … … 114 113 EGREP = @EGREP@ 115 114 EXEEXT = @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@120 115 INSTALL_DATA = @INSTALL_DATA@ 121 116 INSTALL_PROGRAM = @INSTALL_PROGRAM@ … … 151 146 am__quote = @am__quote@ 152 147 bindir = @bindir@ 153 build = @build@154 148 build_alias = @build_alias@ 155 build_cpu = @build_cpu@156 build_os = @build_os@157 build_vendor = @build_vendor@158 149 datadir = @datadir@ 159 150 exec_prefix = @exec_prefix@ 160 host = @host@161 151 host_alias = @host_alias@ 162 host_cpu = @host_cpu@163 host_os = @host_os@164 host_vendor = @host_vendor@165 152 includedir = @includedir@ 166 153 infodir = @infodir@ … … 177 164 sharedstatedir = @sharedstatedir@ 178 165 sysconfdir = @sysconfdir@ 179 target = @target@180 166 target_alias = @target_alias@ 181 target_cpu = @target_cpu@182 target_os = @target_os@183 target_vendor = @target_vendor@184 167 AM_CXXFLAGS = "-I/usr/X11R6/include" 185 168 AM_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 169 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 187 170 noinst_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 188 171 all: all-am -
orxonox/branches/dave/src/command_node.cc
r3155 r3172 37 37 netID = ID; 38 38 bLocalInput = false; 39 39 40 } 40 41 … … 172 173 SDL_Event event; 173 174 Command cmd; 175 174 176 175 177 while( SDL_PollEvent (&event)) … … 181 183 strcpy (cmd.cmd, aliases->keys[event.key.keysym.sym]); 182 184 cmd.bUp = false; 185 186 183 187 if( strlen (cmd.cmd) > 0) relay (&cmd); 184 188 break; … … 186 190 strcpy( cmd.cmd, aliases->keys[event.key.keysym.sym]); 187 191 cmd.bUp = true; 188 cmd.tottime=0.0f;189 192 193 190 194 if( strlen (cmd.cmd) > 0) relay (&cmd); 191 195 break; -
orxonox/branches/dave/src/message_structures.h
r3155 r3172 12 12 typedef struct 13 13 { float tottime; 14 float rottime; 15 float angle; 16 bool angleturn; 17 18 14 19 char cmd[CMD_LENGHT]; //!< the command delivered 15 20 bool bUp; //!< false = command was activated / true = command was deactivated -
orxonox/branches/dave/src/player.cc
r3155 r3172 29 29 obj = new Object ("reaplow.obj"); 30 30 tottime=0.0f; 31 movfinishright=movfinishleft=movfinishup=movfinishdown=false; 32 angleturn=false; 31 33 32 34 /* … … 93 95 { 94 96 //printf("Player|recieved command [%s]\n", cmd->cmd); 97 95 98 tottime=cmd->tottime; 99 rottime=cmd->rottime; 100 angleturn=cmd->angleturn; 101 102 96 103 if( !strcmp( cmd->cmd, "up")) bUp = !cmd->bUp; 97 104 else if( !strcmp( cmd->cmd, "down")) bDown = !cmd->bUp; … … 106 113 glLoadIdentity(); 107 114 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); 109 120 glTranslatef(get_placement()->r.x,get_placement()->r.y,get_placement()->r.z); 110 121 get_placement()->w.matrix (matrix); 111 122 glMultMatrixf ((float*)matrix); 112 123 113 124 glMatrixMode (GL_MODELVIEW); 125 glRotatef (angle,0,0,1); 114 126 glRotatef (-90, 0,1,0); 127 115 128 obj->draw(); 116 129 // glCallList (objectList); … … 141 154 Vector orthDirection(0.0, 0.0, 1.0); 142 155 orthDirection = orthDirection.cross(direction); 156 157 if(rottime<1.0f) 158 rottime=rottime+2.5f*time; 159 else 160 rottime=1.0f; 143 161 if(tottime<1.5f) 144 162 tottime=tottime+4.0f*time; 145 163 else 146 164 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 } 151 220 if( bAscend ) { /* not yet implemented but just: (0,0,1)*acceleration */} 152 221 if( bDescend) {/* FIXME */} -
orxonox/branches/dave/src/player.h
r3155 r3172 41 41 Object* obj; 42 42 float tottime; 43 float tottimecopy; 44 float rottime; 45 float angle; 46 bool angleturn; 47 bool movfinishright,movfinishleft,movfinishup,movfinishdown; 48 49 43 50 44 51 void move (float time);
Note: See TracChangeset
for help on using the changeset viewer.