Changeset 6222 in orxonox.OLD for trunk/src/world_entities/space_ships
- Timestamp:
- Dec 21, 2005, 1:49:06 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
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/helicopter.cc
r6162 r6222 95 95 96 96 this->getWeaponManager()->changeWeaponConfig(1); 97 dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false); 97 98 } 98 99 … … 184 185 185 186 187 188 189 void Helicopter::enter() 190 { 191 dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( true); 192 193 194 } 195 196 void Helicopter::leave() 197 { 198 dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false); 199 200 201 } 202 203 186 204 /** 187 205 * adds a weapon to the weapon list of the spaceship … … 324 342 if(this->getAbsDirZ().y > 0.02) this->shiftDir(Quaternion(time/5, Vector(1,0,0))); 325 343 } 326 344 327 345 if( this->bRight /* > this->getRelCoor().z*2*/) 328 346 { -
trunk/src/world_entities/space_ships/helicopter.h
r6162 r6222 24 24 void loadParams(const TiXmlElement* root); 25 25 26 virtual void enter(); 27 virtual void leave(); 28 26 29 void addWeapon(Weapon* weapon ); 27 30 void removeWeapon(Weapon* weapon); … … 39 42 40 43 private: 41 42 44 void calculateVelocity(float time); 43 45 void weaponAction(); … … 65 67 float travelSpeed; //!< the current speed of the player (to make soft movement) 66 68 float acceleration; //!< the acceleration of the player. 67 69 68 70 float airViscosity; 69 71 -
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; -
trunk/src/world_entities/space_ships/space_ship.h
r6162 r6222 26 26 void init(); 27 27 void loadParams(const TiXmlElement* root); 28 29 virtual void enter(); 30 virtual void leave(); 28 31 29 32 void addWeapon(Weapon* weapon );
Note: See TracChangeset
for help on using the changeset viewer.