Changeset 5906 in orxonox.OLD for branches/spaceshipcontrol/src/world_entities/space_ships/space_ship.cc
- Timestamp:
- Dec 3, 2005, 9:30:54 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/spaceshipcontrol/src/world_entities/space_ships/space_ship.cc
r5905 r5906 256 256 Vector move = (velocity)*time; 257 257 258 /*if( velocity.len() != 0 ) 258 //orient the spaceship model in the direction of movement. 259 if( velocity.len() != 0 ) 259 260 { 260 261 this->setAbsDir(Quaternion(velocity, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0))); 261 262 } 262 */ 263 263 264 this->shiftCoor (move); 264 265 … … 279 280 /* FIXME: calculating the direction and orthDirection every timeSlice is redundant! save it somewhere */ 280 281 /* calculate the direction in which the craft is heading */ 281 Vector direction (1.0, 0.0, 0.0); 282 //direction = this->absDirection.apply (direction); 283 Vector orthDirection (0.0, 0.0, 1.0); 284 //orthDirection = orthDirection.cross (direction); 282 Vector forwardDirection (1.0, 0.0, 0.0); 283 //direction = this->absDirection.apply (direction); 284 Vector rightDirection (0.0, 0.0, 1.0); 285 //orthDirection = orthDirection.cross (direction); 286 Vector upDirection (0.0, 1.0, 0.0); 285 287 286 288 … … 288 290 { 289 291 //if(velocity.len() == 0) 290 accel += direction;//((this->getAbsDir()).getSpacialAxis().getNormalized());292 accel += forwardDirection; 291 293 //else 292 294 //travelSpeed++; … … 296 298 { 297 299 //if(velocity.len() == 0) 298 accel -= direction;//((this->getAbsDir()).getSpacialAxis().getNormalized());300 accel -= forwardDirection; 299 301 // else 300 302 //travelSpeed--; … … 303 305 if( this->bLeft /* > -this->getRelCoor().z*2*/) 304 306 { 305 accel -= (orthDirection);307 accel -= rightDirection; 306 308 //rot +=Vector(1,0,0); 307 309 //rotVal -= .4; … … 309 311 if( this->bRight /* > this->getRelCoor().z*2*/) 310 312 { 311 accel += orthDirection;313 accel += rightDirection; 312 314 //rot += Vector(1,0,0); 313 315 //rotVal += .4; … … 315 317 if (this->bAscend ) 316 318 { 317 accel += Vector(0,1,0);319 accel += upDirection; 318 320 //rot += Vector(0,0,1); 319 321 //rotVal += .4; … … 321 323 if (this->bDescend ) 322 324 { 323 accel -= Vector(0,1,0);325 accel -= upDirection; 324 326 //rot += Vector(0,0,1); 325 327 //rotVal -= .4;
Note: See TracChangeset
for help on using the changeset viewer.