Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 26, 2008, 1:19:21 AM (16 years ago)
Author:
scheusso
Message:

forgot something ;)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/orxonox/objects/SpaceShip.cc

    r1564 r1669  
    4848#include "core/XMLPort.h"
    4949#include "core/ConsoleCommand.h"
    50 #include "network/Client.h"
     50#include "network/Host.h"
    5151#include "hud/HUD.h"
    5252
     
    158158    bool SpaceShip::create(){
    159159      if(!myShip_){
    160         if(network::Client::getSingleton() && objectID == network::Client::getSingleton()->getShipID())
     160        if(network::Host::running() && objectID == network::Host::getShipID())
    161161          myShip_=true;
    162162        else
     
    282282    void SpaceShip::setCamera(const std::string& camera)
    283283    {
    284       myShip_=true; // TODO: this is only a hack
    285284      camName_=camera;
    286285      // change camera attributes here, if you want to ;)
     
    289288    void SpaceShip::getFocus(){
    290289      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_)
    292292        CameraHandler::getInstance()->requestFocus(cam_);
    293293
     
    311311      cam_->setTargetNode(this->getNode());
    312312//        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));
    313315      Quaternion q1 = Quaternion(Radian(Degree(90)),Vector3(0,-1,0));
    314316      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;
    317322        this->setBacksync(true);
    318         CameraHandler::getInstance()->requestFocus(cam_);
     323        //CameraHandler::getInstance()->requestFocus(cam_);
     324        if(this->isExactlyA(Class(SpaceShip)))
     325          getFocus();
    319326      }
    320327
     
    355362        XMLPortParamLoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, mode);
    356363
     364        myShip_=true; //TODO: this is a hack
    357365        SpaceShip::create();
    358         if (this->isExactlyA(Class(SpaceShip)))
    359             getFocus();
     366        /*if (this->isExactlyA(Class(SpaceShip)))
     367            getFocus();*/
    360368    }
    361369
Note: See TracChangeset for help on using the changeset viewer.