Changeset 6222 in orxonox.OLD for trunk/src/world_entities/space_ships/space_ship.cc
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property
svn:ignore
set to
Makefile.in
Makefile
configure
*.kdevelop
Doxyfile
config.log
config.h
config.status
stamp-h1
autom4te.cache
aclocal.m4
-
Property
svn:ignore
set to
-
trunk/src
-
Property
svn:ignore
set to
.deps
orxonox
Makefile
Makefile.in
-
Property
svn:ignore
set to
-
trunk/src/world_entities/space_ships/space_ship.cc
r6162 r6222 112 112 PRINTF(4)("SPACESHIP INIT\n"); 113 113 114 EventHandler::getInstance()->grabEvents(true);114 // EventHandler::getInstance()->grabEvents(true); 115 115 116 116 bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false; … … 177 177 this->getWeaponManager()->getFixedTarget()->setRelCoor(100000,0,0); 178 178 179 dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false); 179 180 } 180 181 … … 188 189 } 189 190 191 192 void SpaceShip::enter() 193 { 194 dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( true); 195 196 197 } 198 199 void SpaceShip::leave() 200 { 201 dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false); 202 203 204 } 190 205 191 206 /** … … 267 282 velocity += ((this->getAbsDirX())*travelSpeed-velocity)*airViscosity; 268 283 velocity = (velocity.getNormalized())*travelSpeed; 269 284 270 285 //orient the spaceship in direction of the mouse 271 286 rotQuat = Quaternion::quatSlerp( this->getAbsDir(),mouseDir,fabsf(time)*3); 272 if (this->getAbsDir().distance(rotQuat) > 0.001) 287 if (this->getAbsDir().distance(rotQuat) > 0.001) 273 288 this->setAbsDir( rotQuat); 274 289 //this->setAbsDirSoft(mouseDir,5); 275 290 276 291 // this is the air friction (necessary for a smooth control) 277 292 if(velocity.len() != 0) velocity -= velocity*0.01; … … 308 323 /* calculate the direction in which the craft is heading */ 309 324 325 Plane plane(Vector(0,1,0), Vector(0,0,0)); 326 310 327 if( this->bUp ) 311 328 { 312 329 //this->shiftCoor(this->getAbsDirX()); 313 330 accel += (this->getAbsDirX())*2; 314 331 315 332 /* Heli-Steuerung 316 333 accel += (this->getAbsDirX()*2;
Note: See TracChangeset
for help on using the changeset viewer.