Changeset 6717 in orxonox.OLD for branches/spaceshipcontrol/src/world_entities/space_ships
- Timestamp:
- Jan 25, 2006, 4:48:26 PM (19 years ago)
- Location:
- branches/spaceshipcontrol/src/world_entities/space_ships
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/spaceshipcontrol/src/world_entities/space_ships/helicopter.cc
r6699 r6717 124 124 125 125 //cycle = 0.0; 126 127 // cameraissue 128 this->cameraNode.setParent(this); 129 this->cameraNode.setParentMode(PNODE_ALL); 126 130 127 131 … … 193 197 // this->getWeaponManager()->setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));: 194 198 195 this->getWeaponManager()->getFixedTarget()->setParent( this);196 this->getWeaponManager()->getFixedTarget()->setRelCoor( 100000,0,0);199 this->getWeaponManager()->getFixedTarget()->setParent(&(this->cameraNode)); 200 this->getWeaponManager()->getFixedTarget()->setRelCoor(0,0,0); 197 201 198 202 dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false); … … 209 213 } 210 214 211 215 void Helicopter::attachCamera() 216 { 217 State::getCamera()->setParentSoft(this->getWeaponManager()->getFixedTarget()); 218 State::getCameraTarget()->setParentSoft(this->getWeaponManager()->getFixedTarget()); 219 220 } 212 221 213 222 … … 272 281 else if (yMouse < -controlVelocityY) yMouse = -controlVelocityY; 273 282 } 283 274 284 // rotorrotation 275 285 this->topRotor.shiftDir(Quaternion(time*10, Vector(0,1,0))); … … 506 516 this->yMouse = event.yRel*mouseSensitivity; 507 517 508 this->shiftDir(Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0))/*Quaternion(-M_PI/4*yMouse*mouseSensitivity, Vector(0,0,1))*/); 509 } 518 this->shiftDir(Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0))); 519 520 Quaternion yDir = Quaternion(-M_PI/4*yMouse*mouseSensitivity, Vector(0,0,1)); 521 522 523 if ((this->cameraNode.getAbsDirY()).y < 0.8) 524 { 525 if((this->cameraNode.getAbsDirX()).y > 0) 526 { 527 if(yMouse > 0) this->cameraNode.shiftDir(yDir);; 528 } 529 else 530 { 531 if(yMouse < 0) this->cameraNode.shiftDir(yDir);; 532 } 533 } 534 else this->cameraNode.shiftDir(yDir);; 535 } 510 536 } 511 537 -
branches/spaceshipcontrol/src/world_entities/space_ships/helicopter.h
r6699 r6717 26 26 virtual void enter(); 27 27 virtual void leave(); 28 virtual void attachCamera(); 28 29 29 30 virtual void postSpawn(); … … 63 64 //float cycle; //!< hovercycle 64 65 65 PNode topRotor; 66 PNode tailRotor; 66 PNode topRotor; 67 PNode tailRotor; 68 69 PNode cameraNode; 67 70 68 71 Vector velocity; //!< the velocity of the player. -
branches/spaceshipcontrol/src/world_entities/space_ships/hover.cc
r6699 r6717 110 110 PRINTF(4)("HOVER INIT\n"); 111 111 112 this->loadModel("models/ships/nimrod _#.obj", 1.0);112 this->loadModel("models/ships/nimrod#.obj", 1.0); 113 113 114 114 EventHandler::getInstance()->grabEvents(true);
Note: See TracChangeset
for help on using the changeset viewer.