Changeset 1407 for code/trunk/src/orxonox/objects
- Timestamp:
- May 24, 2008, 1:49:54 PM (17 years ago)
- Location:
- code/trunk/src/orxonox/objects
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/objects/Camera.h
r1399 r1407 50 50 void setTargetNode(Ogre::SceneNode* obj); 51 51 52 Ogre::Camera* cam_;53 54 52 void tick(float dt); 55 53 void update(); … … 65 63 Ogre::SceneNode* cameraNode_; 66 64 Ogre::Vector3 oldPos; 65 Ogre::Camera* cam_; 67 66 bool bHasFocus_; 68 67 }; -
code/trunk/src/orxonox/objects/SpaceShip.cc
r1401 r1407 69 69 return NULL; 70 70 } 71 71 72 72 SpaceShip::SpaceShip() : 73 73 //testvector_(0,0,0), … … 112 112 this->setConfigValues(); 113 113 114 initialDir_ = Vector3(1.0, 0.0, 0.0);115 currentDir_ = initialDir_;116 initialOrth_ = Vector3(0.0, 0.0, 1.0);117 currentOrth_ = initialOrth_;118 114 119 115 this->setRotationAxis(1, 0, 0); … … 241 237 CameraHandler::getInstance()->requestFocus(cam_); 242 238 243 }244 245 Camera* SpaceShip::getCamera(){246 return cam_;247 239 } 248 240 … … 399 391 } 400 392 401 Vector3 SpaceShip::get Dir() {402 return currentDir_;403 } 404 405 Vector3 SpaceShip::getOrth(){406 return currentOrth_;393 Vector3 SpaceShip::getSPosition() { 394 return SpaceShip::getLocalShip()->getPosition(); 395 } 396 397 Quaternion SpaceShip::getSOrientation() { 398 return SpaceShip::getLocalShip()->getOrientation(); 407 399 } 408 400 … … 411 403 void SpaceShip::tick(float dt) 412 404 { 413 currentDir_ = getOrientation()*initialDir_;414 currentOrth_ = getOrientation()*initialOrth_;415 416 405 if (this->cam_) 417 406 this->cam_->tick(dt); … … 433 422 if (this->bLMousePressed_ && this->timeToReload_ <= 0) 434 423 { 435 424 436 425 Projectile *p = new Projectile(this); 437 426 438 427 p->setBacksync(true); 439 428 this->timeToReload_ = this->reloadTime_; -
code/trunk/src/orxonox/objects/SpaceShip.h
r1400 r1407 44 44 { 45 45 public: 46 46 47 47 static SpaceShip *getLocalShip(); 48 48 49 49 SpaceShip(); 50 50 ~SpaceShip(); … … 64 64 void setTransDamp(float value); 65 65 void setRotDamp(float value); 66 66 67 void getFocus(); 67 68 68 static SpaceShip* instance_s; 69 static Vector3 getSPosition(); 70 static Quaternion getSOrientation(); 69 71 static std::string whereAmI(); 70 72 static void setMaxSpeedTest(float value) … … 78 80 79 81 float getMaxSpeed(); 80 Vector3 getDir();81 Vector3 getOrth();82 Camera* getCamera();83 82 84 83 private: … … 86 85 87 86 Vector3 testvector_; 88 Vector3 initialDir_;89 Vector3 currentDir_;90 Vector3 initialOrth_;91 Vector3 currentOrth_;92 87 bool bInvertYAxis_; 93 88 bool setMouseEventCallback_;
Note: See TracChangeset
for help on using the changeset viewer.