Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 15, 2008, 3:54:30 PM (16 years ago)
Author:
bknecht
Message:

camera stuff works now, but maybe need some adjustments, please test this while playing

File:
1 edited

Legend:

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

    r1235 r1287  
    7979
    8080        this->camNode_ = 0;
     81        this->cam_ = NULL;
    8182
    8283        this->tt_ = 0;
     
    148149        if (this->tt_)
    149150            delete this->tt_;
     151        if (this->cam_)
     152          delete this->cam_;
    150153    }
    151154
     
    284287    {
    285288        this->camNode_ = this->getNode()->createChildSceneNode("CamNode");
    286         camNode_->setPosition(Vector3(-50,0,10));
     289        camNode_->setPosition(Vector3(-30,0,10));
     290        Quaternion q1 = Quaternion(Radian(Degree(90)),Vector3(0,-1,0));
     291        Quaternion q2 = Quaternion(Radian(Degree(90)),Vector3(0,0,-1));
     292        camNode_->setOrientation(q1*q2);
     293        //this->camNode_->showBoundingBox(true);
     294
    287295/*
    288296//        node->setInheritOrientation(false);
     
    292300*/
    293301        cam_ = new Camera(this->camNode_);
    294         cam_->setTargetNode(this->getNode());
     302        cam_->setTargetNode(this->chFarNode_);
    295303        CameraHandler::getInstance()->requestFocus(cam_);
    296304//        cam->setPosition(Vector3(0,-350,0));
     
    427435
    428436    void SpaceShip::tick(float dt)
    429     {
     437    {/*
     438      if (this->cam_)
     439        this->cam_->update();
     440      */
     441      if (this->cam_)
     442        this->cam_->tick(dt);
     443
    430444      if (InputManager::getSingleton().getMouse()->getEventCallback() != this)
    431445        {
Note: See TracChangeset for help on using the changeset viewer.