Changeset 3155 in orxonox.OLD for orxonox/branches/dave/src/player.cc
- Timestamp:
- Dec 11, 2004, 8:38:55 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/dave/src/player.cc
r3151 r3155 19 19 #include "stdincl.h" 20 20 #include "collision.h" 21 #include "command_node.h" 21 22 22 23 using namespace std; … … 27 28 28 29 obj = new Object ("reaplow.obj"); 30 tottime=0.0f; 31 29 32 /* 30 33 objectList = glGenLists(1); … … 90 93 { 91 94 //printf("Player|recieved command [%s]\n", cmd->cmd); 95 tottime=cmd->tottime; 92 96 if( !strcmp( cmd->cmd, "up")) bUp = !cmd->bUp; 93 97 else if( !strcmp( cmd->cmd, "down")) bDown = !cmd->bUp; … … 137 141 Vector orthDirection(0.0, 0.0, 1.0); 138 142 orthDirection = orthDirection.cross(direction); 139 140 if( bUp) { accel = accel+(direction*acceleration); } 141 if( bDown) { accel = accel-(direction*acceleration); } 142 if( bLeft ) { accel = accel + (orthDirection*acceleration); } 143 if( bRight ) { accel = accel - (orthDirection*acceleration); } 143 if(tottime<1.5f) 144 tottime=tottime+4.0f*time; 145 else 146 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));} 144 151 if( bAscend ) { /* not yet implemented but just: (0,0,1)*acceleration */} 145 152 if( bDescend) {/* FIXME */} … … 156 163 157 164 /* this updates the player position on the track - user interaction */ 158 l->pos = l->pos + accel*time;165 l->pos = l->pos + (accel*time); 159 166 } 160 167
Note: See TracChangeset
for help on using the changeset viewer.