Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 15, 2008, 4:43:20 PM (17 years ago)
Author:
scheusso
Message:

merged camera change into merger branch

File:
1 edited

Legend:

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

    r1284 r1289  
    106106        this->setConfigValues();
    107107
     108
    108109        this->setRotationAxis(1, 0, 0);
    109110        this->setStatic(false);
     
    118119        if(setMouseEventCallback_)
    119120          InputManager::removeMouseHandler("SpaceShip");
     121        if (this->cam_)
     122          delete this->cam_;
    120123    }
    121124
     
    286289      this->camNode_ = this->getNode()->createChildSceneNode(camName_);
    287290      COUT(4) << "position: (this)" << this->getNode()->getPosition() << std::endl;
    288       this->camNode_->setPosition(/*this->getNode()->getPosition() +*/ Vector3(-50,0,10));
     291      this->camNode_->setPosition(Vector3(-50,0,10));
     292      Quaternion q1 = Quaternion(Radian(Degree(90)),Vector3(0,-1,0));
     293      Quaternion q2 = Quaternion(Radian(Degree(90)),Vector3(0,0,-1));
     294      camNode_->setOrientation(q1*q2);
    289295      COUT(4) << "position: (cam)" << this->camNode_->getPosition() << std::endl;
    290 /*
    291 //        node->setInheritOrientation(false);
    292         cam->setPosition(Vector3(0,50,-150));
    293         cam->lookAt(Vector3(0,20,0));
    294         cam->roll(Degree(0));
    295       *//*COUT(4) << "creating new camera" << std::endl;*/
    296296      cam_ = new Camera(this->camNode_);
    297297
     
    436436    void SpaceShip::tick(float dt)
    437437    {
     438        if (this->cam_)
     439            this->cam_->tick(dt);
     440
    438441        if (this->redNode_ && this->greenNode_)
    439442        {
Note: See TracChangeset for help on using the changeset viewer.