Changeset 1669 for code/branches/network/src/orxonox/objects
- Timestamp:
- Aug 26, 2008, 1:19:21 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/orxonox/objects/SpaceShip.cc
r1564 r1669 48 48 #include "core/XMLPort.h" 49 49 #include "core/ConsoleCommand.h" 50 #include "network/ Client.h"50 #include "network/Host.h" 51 51 #include "hud/HUD.h" 52 52 … … 158 158 bool SpaceShip::create(){ 159 159 if(!myShip_){ 160 if(network:: Client::getSingleton() && objectID == network::Client::getSingleton()->getShipID())160 if(network::Host::running() && objectID == network::Host::getShipID()) 161 161 myShip_=true; 162 162 else … … 282 282 void SpaceShip::setCamera(const std::string& camera) 283 283 { 284 myShip_=true; // TODO: this is only a hack285 284 camName_=camera; 286 285 // change camera attributes here, if you want to ;) … … 289 288 void SpaceShip::getFocus(){ 290 289 COUT(4) << "requesting focus" << std::endl; 291 if(network::Client::getSingleton()==0 || network::Client::getSingleton()->getShipID()==objectID) 290 //if(!network::Host::running() || network::Host::getShipID()==objectID) 291 if(myShip_) 292 292 CameraHandler::getInstance()->requestFocus(cam_); 293 293 … … 311 311 cam_->setTargetNode(this->getNode()); 312 312 // cam->setPosition(Vector3(0,-350,0)); 313 // Quaternion q1 = Quaternion(Radian(Degree(90)),Vector3(0,0,1)); 314 // Quaternion q2 = Quaternion(Radian(Degree(90)),Vector3(0,1,0)); 313 315 Quaternion q1 = Quaternion(Radian(Degree(90)),Vector3(0,-1,0)); 314 316 Quaternion q2 = Quaternion(Radian(Degree(90)),Vector3(1,0,0)); 315 this->camNode_->setOrientation(q2*q1); 316 if(network::Client::getSingleton()!=0 && network::Client::getSingleton()->getShipID()==objectID){ 317 318 this->camNode_->setOrientation(q2*q1); 319 //if(!network::Host::running() || network::Host::getShipID()==objectID){ //TODO: check this 320 if(myShip_){ 321 COUT(3) << "requesting focus for camera" << std::endl; 317 322 this->setBacksync(true); 318 CameraHandler::getInstance()->requestFocus(cam_); 323 //CameraHandler::getInstance()->requestFocus(cam_); 324 if(this->isExactlyA(Class(SpaceShip))) 325 getFocus(); 319 326 } 320 327 … … 355 362 XMLPortParamLoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, mode); 356 363 364 myShip_=true; //TODO: this is a hack 357 365 SpaceShip::create(); 358 if (this->isExactlyA(Class(SpaceShip)))359 getFocus(); 366 /*if (this->isExactlyA(Class(SpaceShip))) 367 getFocus();*/ 360 368 } 361 369
Note: See TracChangeset
for help on using the changeset viewer.