Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 10, 2008, 5:03:34 PM (16 years ago)
Author:
bknecht
Message:

merged back that script-branch

File:
1 edited

Legend:

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

    r978 r1021  
    3939#include "util/String2Number.h"
    4040#include "util/Math.h"
    41 #include "../core/CoreIncludes.h"
    42 #include "../core/Debug.h"
    43 #include "../Orxonox.h"
    44 #include "../particle/ParticleInterface.h"
     41#include "core/CoreIncludes.h"
     42#include "core/Debug.h"
     43#include "Orxonox.h"
     44#include "InputHandler.h"
     45#include "particle/ParticleInterface.h"
    4546#include "Projectile.h"
    4647#include "core/XMLPort.h"
     
    5556    {
    5657        RegisterObject(SpaceShip);
     58        this->registerAllVariables();
    5759
    5860        this->setConfigValues();
     
    124126        this->brakeLoop(loop);
    125127*/
    126         this->init();
    127 
     128//         this->create();
     129
     130       
    128131        COUT(3) << "Info: SpaceShip was loaded" << std::endl;
    129132    }
     
    135138    }
    136139
     140    bool SpaceShip::create(){
     141      if(Model::create())
     142        this->init();
     143      else
     144        return false;
     145      return true;
     146    }
     147   
     148    void SpaceShip::registerAllVariables(){
     149      Model::registerAllVariables();
     150     
     151     
     152     
     153    }
     154   
    137155    void SpaceShip::init()
    138156    {
     
    202220    {
    203221        Model::loadParams(xmlElem);
     222        this->create();
    204223/*
    205224        if (xmlElem->Attribute("forward") && xmlElem->Attribute("rotateupdown") && xmlElem->Attribute("rotaterightleft") && xmlElem->Attribute("looprightleft"))
     
    267286
    268287        this->camNode_->attachObject(cam);
    269         Orxonox::getSingleton()->getOgrePointer()->getRoot()->getAutoCreatedWindow()->addViewport(cam);
     288        Orxonox::getSingleton()->getOgrePointer()->getRenderWindow()->addViewport(cam);
    270289    }
    271290
     
    400419        if (!this->setMouseEventCallback_)
    401420        {
    402             if (Orxonox::getSingleton()->getMouse())
     421            if (InputHandler::getSingleton()->getMouse())
    403422            {
    404                 Orxonox::getSingleton()->getMouse()->setEventCallback(this);
     423                InputHandler::getSingleton()->getMouse()->setEventCallback(this);
    405424                this->setMouseEventCallback_ = true;
    406425            }
     
    427446        }
    428447
    429         OIS::Keyboard* mKeyboard = Orxonox::getSingleton()->getKeyboard();
    430         OIS::Mouse* mMouse = Orxonox::getSingleton()->getMouse();
     448        OIS::Keyboard* mKeyboard = InputHandler::getSingleton()->getKeyboard();
     449        OIS::Mouse* mMouse = InputHandler::getSingleton()->getMouse();
    431450
    432451        mKeyboard->capture();
Note: See TracChangeset for help on using the changeset viewer.