Changeset 1406 for code/branches/network/src/orxonox/objects
- Timestamp:
- May 24, 2008, 1:39:05 PM (17 years ago)
- Location:
- code/branches/network/src/orxonox/objects
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/orxonox/objects/Camera.h
r1293 r1406 50 50 void setTargetNode(Ogre::SceneNode* obj); 51 51 52 Ogre::Camera* cam_; 53 52 54 void tick(float dt); 53 55 void update(); … … 63 65 Ogre::SceneNode* cameraNode_; 64 66 Ogre::Vector3 oldPos; 65 Ogre::Camera* cam_;66 67 bool bHasFocus_; 67 68 }; -
code/branches/network/src/orxonox/objects/SpaceShip.cc
r1398 r1406 75 75 return NULL; 76 76 } 77 77 78 78 SpaceShip::SpaceShip() : 79 79 //testvector_(0,0,0), … … 118 118 this->setConfigValues(); 119 119 120 initialDir_ = Vector3(1.0, 0.0, 0.0); 121 currentDir_ = initialDir_; 122 initialOrth_ = Vector3(0.0, 0.0, 1.0); 123 currentOrth_ = initialOrth_; 120 124 121 125 this->setRotationAxis(1, 0, 0); … … 233 237 CameraHandler::getInstance()->requestFocus(cam_); 234 238 239 } 240 241 Camera* SpaceShip::getCamera(){ 242 return cam_; 235 243 } 236 244 … … 318 326 } 319 327 328 Vector3 SpaceShip::getDir() { 329 return currentDir_; 330 } 331 332 Vector3 SpaceShip::getOrth(){ 333 return currentOrth_; 334 } 335 320 336 float SpaceShip::getMaxSpeed() { return maxSpeed_; } 321 337 322 338 void SpaceShip::tick(float dt) 323 339 { 340 currentDir_ = getOrientation()*initialDir_; 341 currentOrth_ = getOrientation()*initialOrth_; 342 324 343 if (this->cam_) 325 344 this->cam_->tick(dt); … … 341 360 if (this->bLMousePressed_ && this->timeToReload_ <= 0) 342 361 { 343 362 344 363 Projectile *p = new Projectile(this); 345 364 346 365 p->setBacksync(true); 347 366 this->timeToReload_ = this->reloadTime_; -
code/branches/network/src/orxonox/objects/SpaceShip.h
r1398 r1406 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 void getFocus(); 66 67 67 void getFocus();68 static Vector3 getSPosition();69 static Quaternion getSOrientation();70 68 static std::string whereAmI(); 71 69 static void setMaxSpeedTest(float value) … … 80 78 81 79 float getMaxSpeed(); 80 Vector3 getDir(); 81 Vector3 getOrth(); 82 Camera* getCamera(); 82 83 83 84 private: … … 85 86 86 87 Vector3 testvector_; 88 Vector3 initialDir_; 89 Vector3 currentDir_; 90 Vector3 initialOrth_; 91 Vector3 currentOrth_; 87 92 bool bInvertYAxis_; 88 93 bool setMouseEventCallback_;
Note: See TracChangeset
for help on using the changeset viewer.