Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 29, 2008, 5:15:44 PM (17 years ago)
Author:
bknecht
Message:

CameraHandler and Camera work now

File:
1 edited

Legend:

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

    r1064 r1201  
    2323 *      Fabian 'x3n' Landau
    2424 *   Co-authors:
    25  *      ...
     25 *      Benjamin Knecht
    2626 *
    2727 */
     
    3838#include <OgreSceneNode.h>
    3939
     40#include "CameraHandler.h"
    4041#include "util/tinyxml/tinyxml.h"
    4142#include "util/Convert.h"
     
    282283    void SpaceShip::setCamera(const std::string& camera)
    283284    {
    284         Ogre::Camera *cam = GraphicsEngine::getSingleton().getSceneManager()->createCamera("ShipCam");
    285285        this->camNode_ = this->getNode()->createChildSceneNode("CamNode");
     286        camNode_->setPosition(this->getNode()->getPosition() + Vector3(-50,0,10));
    286287/*
    287288//        node->setInheritOrientation(false);
     
    290291        cam->roll(Degree(0));
    291292*/
    292 
    293         cam->setPosition(Vector3(-200,0,35));
     293        cam_ = new Camera(this->camNode_);
     294        cam_->setTargetNode(this->getNode());
     295        CameraHandler::getInstance()->requestFocus(cam_);
    294296//        cam->setPosition(Vector3(0,-350,0));
    295         cam->lookAt(Vector3(0,0,35));
    296         cam->roll(Degree(-90));
    297 
    298         this->camNode_->attachObject(cam);
    299         GraphicsEngine::getSingleton().getRenderWindow()->addViewport(cam);
     297        //cam->roll(Degree(-90));
     298
     299        //this->camNode_->attachObject(cam);
    300300    }
    301301
Note: See TracChangeset for help on using the changeset viewer.