Changeset 5912 in orxonox.OLD for branches/spaceshipcontrol/src/world_entities
- Timestamp:
- Dec 4, 2005, 2:39:35 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/spaceshipcontrol/src/world_entities/space_ships/space_ship.cc
r5911 r5912 258 258 259 259 //orient the spaceship model in the direction of movement. 260 if( velocity.len() != 0 )261 {262 this->setAbsDir(Quaternion(velocity, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)));263 }264 260 265 261 this->shiftCoor (move); … … 279 275 //Vector rot(0.0, 0.0, 0.0); 280 276 //float rotVal = 0.0; 281 277 /* FIXME: calculating the direction and orthDirection every timeSlice is redundant! save it somewhere */ 282 278 /* calculate the direction in which the craft is heading */ 283 Vector forwardDirection = (this->getAbsDirX()).getNormalized(); //x284 //direction = this->absDirection.apply (direction);285 Vector rightDirection = (this->getAbsDirZ()).getNormalized(); //z286 //orthDirection = orthDirection.cross (direction);287 Vector upDirection = (this->getAbsDirY()).getNormalized(); //y288 289 290 291 279 292 280 if( this->bUp ) 293 281 { 294 accel += forwardDirection;282 this->shiftCoor(this->getAbsDirX()); 295 283 //if(travelSpeed <= 5000) travelSpeed += 10; 296 284 } … … 298 286 if( this->bDown ) 299 287 { 300 accel -= forwardDirection;288 this->shiftCoor(Vector()-this->getAbsDirX()); 301 289 //if(travelSpeed >= 10) travelSpeed -= 10; 302 290 } … … 304 292 if( this->bLeft /* > -this->getRelCoor().z*2*/) 305 293 { 306 accel -= rightDirection; 294 this->shiftDir(Quaternion(time, Vector(0,1,0))); 295 // accel -= rightDirection; 307 296 //velocityDir.normalize(); 308 297 //rot +=Vector(1,0,0); … … 311 300 if( this->bRight /* > this->getRelCoor().z*2*/) 312 301 { 313 accel += rightDirection; 302 this->shiftDir(Quaternion(-time, Vector(0,1,0))); 303 304 // accel += rightDirection; 314 305 //velocityDir.normalize(); 315 306 //rot += Vector(1,0,0); … … 318 309 if (this->bAscend ) 319 310 { 320 accel += upDirection; 311 this->shiftDir(Quaternion(time, Vector(0,0,1))); 312 313 // accel += upDirection; 321 314 //velocityDir.normalize(); 322 315 //rot += Vector(0,0,1); … … 325 318 if (this->bDescend ) 326 319 { 327 accel -= upDirection; 320 this->shiftDir(Quaternion(-time, Vector(0,0,1))); 321 322 // accel -= upDirection; 328 323 //velocityDir.normalize(); 329 324 //rot += Vector(0,0,1);
Note: See TracChangeset
for help on using the changeset viewer.