Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 13, 2008, 3:45:19 PM (17 years ago)
Author:
rgrieder
Message:
  • merged ogre branch into merge branch
Location:
code/branches/merge/src/orxonox/objects
Files:
7 edited

Legend:

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

    r1056 r1263  
    4545    CreateFactory(Explosion);
    4646
    47     Explosion::Explosion(WorldEntity* owner)
     47    Explosion::Explosion(WorldEntity* owner) :
     48      particle_(0),
     49      lifetime_(0.4)
    4850    {
    4951        RegisterObject(Explosion);
    50 
    51         this->particle_ = 0;
    52         this->lifetime_ = 0.4;
    5352
    5453        if (owner)
  • code/branches/merge/src/orxonox/objects/Model.cc

    r1209 r1263  
    4949    }
    5050
    51     void Model::loadParams(TiXmlElement* xmlElem)
    52     {
    53         WorldEntity::loadParams(xmlElem);
    54 
    55         if (xmlElem->Attribute("mesh"))
    56         {
    57             meshSrc_ = xmlElem->Attribute("mesh");
    58         }
    59         create();
    60     }
    61 
    6251    /**
    6352        @brief XML loading and saving.
  • code/branches/merge/src/orxonox/objects/Model.h

    r1056 r1263  
    4343            Model();
    4444            virtual ~Model();
    45             virtual void loadParams(TiXmlElement* xmlElem);
    4645            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    4746            void setMesh(const std::string& meshname);
  • code/branches/merge/src/orxonox/objects/NPC.cc

    r1056 r1263  
    3636  CreateFactory(NPC);
    3737
    38   NPC::NPC()
     38  NPC::NPC() :
     39    movable_(true)
    3940  {
    4041    RegisterObject(NPC);
    41     movable_ = true;
    4242  }
    4343
  • code/branches/merge/src/orxonox/objects/Projectile.cc

    r1056 r1263  
    4242    CreateFactory(Projectile);
    4343
    44     Projectile::Projectile(SpaceShip* owner)
     44    Projectile::Projectile(SpaceShip* owner) :
     45      owner_(owner)
    4546    {
    4647        RegisterObject(Projectile);
    4748
    4849        this->setConfigValues();
    49 
    50         this->owner_ = owner;
    5150
    5251        this->billboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 1.0, 0.5), 1);
  • code/branches/merge/src/orxonox/objects/SpaceShip.cc

    r1219 r1263  
    6464    SpaceShip::SpaceShip()
    6565    {
    66         RegisterObject(SpaceShip);
    67         this->registerAllVariables();
    68 
    6966        SpaceShip::instance_s = this;
    70 
    71         this->setConfigValues();
    7267
    7368        this->setMouseEventCallback_ = false;
     
    139134//         this->create();
    140135
     136        RegisterObject(SpaceShip);
     137        this->registerAllVariables();
     138        this->setConfigValues();
    141139
    142140        COUT(3) << "Info: SpaceShip was loaded" << std::endl;
     
    166164    void SpaceShip::init()
    167165    {
     166        if (!setMouseEventCallback_)
     167        {
     168          InputManager::addMouseHandler(this, "SpaceShip");
     169          setMouseEventCallback_ = true;
     170        }
     171
    168172        // START CREATING THRUSTER
    169173        this->tt_ = new ParticleInterface(GraphicsEngine::getSingleton().getSceneManager(),"twinthruster" + this->getName(),"Orxonox/engineglow");
     
    428432    void SpaceShip::tick(float dt)
    429433    {
    430         if (!setMouseEventCallback_)
    431         {
    432           InputManager::addMouseHandler(this, "SpaceShip");
    433           setMouseEventCallback_ = true;
    434         }
    435 
    436434        if (this->redNode_ && this->greenNode_)
    437435        {
  • code/branches/merge/src/orxonox/objects/WorldEntity.cc

    r1209 r1263  
    4545    unsigned int WorldEntity::worldEntityCounter_s = 0;
    4646
    47     WorldEntity::WorldEntity()
     47    WorldEntity::WorldEntity() :
     48      velocity_    (0, 0, 0),
     49      acceleration_(0, 0, 0),
     50      rotationAxis_(0, 1, 0),
     51      rotationRate_(0),
     52      momentum_    (0),
     53      node_        (0),
     54      bStatic_     (true)
    4855    {
    4956        RegisterObject(WorldEntity);
    50 
    51         //create();
    52 
    53         this->bStatic_ = true;
    54         this->velocity_ = Vector3(0, 0, 0);
    55         this->acceleration_ = Vector3(0, 0, 0);
    56         this->rotationAxis_ = Vector3(0, 1, 0);
    57         this->rotationRate_ = 0;
    58         this->momentum_ = 0;
    5957
    6058        if (GraphicsEngine::getSingleton().getSceneManager())
     
    6664
    6765          registerAllVariables();
    68         }
    69         else
    70         {
    71           this->node_ = 0;
    7266        }
    7367    }
     
    9488        BaseObject::loadParams(xmlElem);
    9589        create();
    96 /*
    97         if (xmlElem->Attribute("position"))
    98         {
    99             std::vector<std::string> pos = tokenize(xmlElem->Attribute("position"),",");
    100             float x, y, z;
    101             String2Number<float>(x, pos[0]);
    102             String2Number<float>(y, pos[1]);
    103             String2Number<float>(z, pos[2]);
    104             this->setPosition(x, y, z);
    105         }
    106 
    107         if (xmlElem->Attribute("direction"))
    108         {
    109             std::vector<std::string> pos = tokenize(xmlElem->Attribute("direction"),",");
    110             float x, y, z;
    111             String2Number<float>(x, pos[0]);
    112             String2Number<float>(y, pos[1]);
    113             String2Number<float>(z, pos[2]);
    114             this->setDirection(x, y, z);
    115         }
    116 
    117         if (xmlElem->Attribute("yaw") || xmlElem->Attribute("pitch") || xmlElem->Attribute("roll"))
    118         {
    119             float yaw = 0.0, pitch = 0.0, roll = 0.0;
    120             if (xmlElem->Attribute("yaw"))
    121                 String2Number<float>(yaw,xmlElem->Attribute("yaw"));
    122 
    123             if (xmlElem->Attribute("pitch"))
    124                 String2Number<float>(pitch,xmlElem->Attribute("pitch"));
    125 
    126             if (xmlElem->Attribute("roll"))
    127                 String2Number<float>(roll,xmlElem->Attribute("roll"));
    128 
    129             this->yaw(Degree(yaw));
    130             this->pitch(Degree(pitch));
    131             this->roll(Degree(roll));
    132         }
    133 
    134         if (xmlElem->Attribute("scale"))
    135         {
    136             std::string scaleStr = xmlElem->Attribute("scale");
    137             float scale;
    138             String2Number<float>(scale, scaleStr);
    139             this->setScale(scale);
    140         }
    141 
    142         if (xmlElem->Attribute("rotationAxis"))
    143         {
    144             std::vector<std::string> pos = tokenize(xmlElem->Attribute("rotationAxis"),",");
    145             float x, y, z;
    146             String2Number<float>(x, pos[0]);
    147             String2Number<float>(y, pos[1]);
    148             String2Number<float>(z, pos[2]);
    149             this->setRotationAxis(x, y, z);
    150         }
    151 
    152         if (xmlElem->Attribute("rotationRate"))
    153         {
    154             float rotationRate;
    155             String2Number<float>(rotationRate, xmlElem->Attribute("rotationRate"));
    156             this->setRotationRate(Degree(rotationRate));
    157             if (rotationRate != 0)
    158                 this->setStatic(false);
    159         }
    160 
    161         create();
    162 */
    16390    }
    16491
Note: See TracChangeset for help on using the changeset viewer.