Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1592 for code/branches/core3


Ignore:
Timestamp:
Jun 12, 2008, 4:32:10 AM (16 years ago)
Author:
landauf
Message:
  • Some small changes in XMLPortParam: It's now possible to add functions of another class. an example is setPosition and getPosition that are directly referred to Ogre::Node. Use XMLPortParamExtern if you need this. It takes the object to call the functions on as an additional argument (in our example: this→node_).
  • Removed loadParams functions and reduced the usage of XMLPortParamLoadOnly in several classes
Location:
code/branches/core3/src
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core3/src/audio/AudioManager.h

    r1535 r1592  
    5858                void setOri(std::vector<float> at, std::vector<float> up);
    5959
    60                 // Parses given xml string
    61                 void loadParams();
    62 
    6360                // Update
    6461                void tick(float dt);
  • code/branches/core3/src/core/BaseObject.cc

    r1559 r1592  
    6666
    6767    /**
    68         @brief load general xml paramters
    69     */
    70     void BaseObject::loadParams(TiXmlElement* xmlElem)
    71     {
    72         if (xmlElem->Attribute("name"))
    73         {
    74             this->setName(xmlElem->Attribute("name"));
    75         }
    76     }
    77 
    78     /**
    7968        @brief XML loading and saving.
    8069        @param xmlelement The XML-element
  • code/branches/core3/src/core/BaseObject.h

    r1558 r1592  
    5252            BaseObject();
    5353            virtual ~BaseObject();
    54             virtual void loadParams(TiXmlElement* xmlElem);
    5554            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5655
  • code/branches/core3/src/core/Functor.h

    r1586 r1592  
    8080    CreateTypeToStringTemplate(Degree);
    8181
    82     template <> \
    83     inline std::string typeToString<std::string>() { return "string"; } \
    84     template <> \
    85     inline std::string typeToString<std::string&>() { return "string"; } \
    86     template <> \
    87     inline std::string typeToString<const std::string>() { return "string"; } \
    88     template <> \
     82    template <>
     83    inline std::string typeToString<std::string>() { return "string"; }
     84    template <>
     85    inline std::string typeToString<std::string&>() { return "string"; }
     86    template <>
     87    inline std::string typeToString<const std::string>() { return "string"; }
     88    template <>
    8989    inline std::string typeToString<const std::string&>() { return "string"; }
    9090
  • code/branches/core3/src/core/Identifier.cc

    r1591 r1592  
    4242#include "ObjectList.h"
    4343#include "OrxonoxClass.h"
     44#include "XMLPort.h"
    4445
    4546namespace orxonox
     
    206207
    207208    /**
     209        @brief Tells the container to which Identifier it belongs to.
     210    */
     211    void Identifier::addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container)
     212    {
     213        container->setIdentifier(this);
     214    }
     215
     216    /**
    208217        @brief Returns true, if the Identifier is at least of the given type.
    209218        @param identifier The identifier to compare with
  • code/branches/core3/src/core/Identifier.h

    r1591 r1592  
    206206            ConfigValueContainer* getLowercaseConfigValueContainer(const std::string& varname);
    207207
    208             virtual void addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container) = 0;
     208            virtual void addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container);
    209209            virtual XMLPortParamContainer* getXMLPortParamContainer(const std::string& paramname) = 0;
    210210
     
    313313            ~ClassIdentifier() {}                                       // don't delete
    314314
    315             std::map<std::string, XMLPortClassParamContainer<T>*> xmlportParamContainers_;              //!< All loadable parameters
     315            std::map<std::string, XMLPortClassParamContainer<class O>*> xmlportParamContainers_;              //!< All loadable parameters
    316316            std::map<std::string, XMLPortClassObjectContainer<T, class O>*> xmlportObjectContainers_;   //!< All attachable objects
    317317
     
    427427    XMLPortParamContainer* ClassIdentifier<T>::getXMLPortParamContainer(const std::string& paramname)
    428428    {
    429         typename std::map<std::string, XMLPortClassParamContainer<T>*>::const_iterator it = xmlportParamContainers_.find(paramname);
     429        typename std::map<std::string, XMLPortClassParamContainer<class O>*>::const_iterator it = xmlportParamContainers_.find(paramname);
    430430        if (it != xmlportParamContainers_.end())
    431431            return (XMLPortParamContainer*)((*it).second);
     
    442442    void ClassIdentifier<T>::addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container)
    443443    {
    444         this->xmlportParamContainers_[paramname] = (XMLPortClassParamContainer<T>*)container;
     444        Identifier::addXMLPortParamContainer(paramname, container);
     445        this->xmlportParamContainers_[paramname] = (XMLPortClassParamContainer<class O>*)container;
    445446    }
    446447
  • code/branches/core3/src/core/XMLPort.h

    r1586 r1592  
    4242
    4343#define XMLPortParam(classname, paramname, loadfunction, savefunction, xmlelement, mode) \
    44     XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, paramname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), #savefunction), xmlelement, mode)
    45 #define XMLPortParam_Template(classname, paramname, loadtemplate, loadfunction, savetemplate, savefunction, xmlelement, mode) \
    46     XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, paramname, orxonox::createExecutor(orxonox::createFunctor loadtemplate (&classname::loadfunction), #loadfunction), orxonox::createExecutor(orxonox::createFunctor savetemplate (&classname::savefunction), #savefunction), xmlelement, mode)
     44    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, this, paramname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction), xmlelement, mode)
     45#define XMLPortParamTemplate(classname, paramname, loadfunction, savefunction, xmlelement, mode, ...) \
     46    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, this, paramname, orxonox::createExecutor(orxonox::createFunctor< __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction), xmlelement, mode)
    4747
    4848#define XMLPortParamLoadOnly(classname, paramname, loadfunction, xmlelement, mode) \
    49     XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, paramname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), #loadfunction), 0, xmlelement, mode)
    50 #define XMLPortParamLoadOnly_Template(classname, paramname, loadtemplate, loadfunction, xmlelement, mode) \
    51     XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, paramname, orxonox::createExecutor(orxonox::createFunctor loadtemplate (&classname::loadfunction), #loadfunction), 0, xmlelement, mode)
    52 
    53 #define XMLPortParamGeneric(containername, classname, paramname, loadexecutor, saveexecutor, xmlelement, mode) \
     49    XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, this, paramname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), 0, xmlelement, mode)
     50#define XMLPortParamLoadOnlyTemplate(classname, paramname, loadfunction, xmlelement, mode, ...) \
     51    XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, this, paramname, orxonox::createExecutor(orxonox::createFunctor< __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), 0, xmlelement, mode)
     52
     53#define XMLPortParamExtern(classname, object, paramname, loadfunction, savefunction, xmlelement, mode) \
     54    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, object, paramname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction), xmlelement, mode);
     55#define XMLPortParamExternTemplate(classname, object, paramname, loadfunction, savefunction, xmlelement, mode, ...) \
     56    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, object, paramname, orxonox::createExecutor(orxonox::createFunctor< __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction), xmlelement, mode);
     57
     58#define XMLPortParamGeneric(containername, classname, object, paramname, loadexecutor, saveexecutor, xmlelement, mode) \
    5459    orxonox::XMLPortClassParamContainer<classname>* containername = (orxonox::XMLPortClassParamContainer<classname>*)(this->getIdentifier()->getXMLPortParamContainer(paramname)); \
    5560    if (!containername) \
     
    5863        this->getIdentifier()->addXMLPortParamContainer(paramname, containername); \
    5964    } \
    60     containername->port(this, xmlelement, mode)
     65    containername->port(object, xmlelement, mode)
    6166
    6267
    6368#define XMLPortObject(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, mode, bApplyLoaderMask, bLoadBefore) \
    64     XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), #savefunction), xmlelement, mode, bApplyLoaderMask, bLoadBefore)
    65 #define XMLPortObject_Template(classname, objectclass, sectionname, loadtemplate, loadfunction, savetemplate, savefunction, xmlelement, mode, bApplyLoaderMask, bLoadBefore) \
    66     XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, orxonox::createExecutor(orxonox::createFunctor loadtemplate (&classname::loadfunction), #loadfunction), orxonox::createExecutor(orxonox::createFunctor savetemplate (&classname::savefunction), #savefunction), xmlelement, mode, bApplyLoaderMask, bLoadBefore)
     69    XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction), xmlelement, mode, bApplyLoaderMask, bLoadBefore)
     70#define XMLPortObjectTemplate(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, mode, bApplyLoaderMask, bLoadBefore, ...) \
     71    XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, orxonox::createExecutor(orxonox::createFunctor< __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction), xmlelement, mode, bApplyLoaderMask, bLoadBefore)
    6772
    6873#define XMLPortObjectGeneric(containername, classname, objectclass, sectionname, loadexecutor, saveexecutor, xmlelement, mode, bApplyLoaderMask, bLoadBefore) \
     
    98103            inline const std::string& getName() const
    99104                { return this->paramname_; }
     105            inline void setIdentifier(Identifier* identifier)
     106                { this->identifier_ = identifier; }
    100107
    101108            virtual XMLPortParamContainer& description(const std::string description) = 0;
     
    112119            std::string paramname_;
    113120            ParseResult parseResult_;
    114 
     121            Identifier* identifier_;
    115122    };
    116123
     
    146153                        if ((attribute.size() > 0) || (this->loadexecutor_->allDefaultValuesSet()))
    147154                        {
    148                             COUT(5) << ((BaseObject*)object)->getLoaderIndentation() << "Loading parameter " << this->paramname_ << " in " << object->getIdentifier()->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")." << std::endl << ((BaseObject*)object)->getLoaderIndentation();
     155                            COUT(5) << ((BaseObject*)object)->getLoaderIndentation() << "Loading parameter " << this->paramname_ << " in " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")." << std::endl << ((BaseObject*)object)->getLoaderIndentation();
    149156                            if (this->loadexecutor_->parse(object, attribute, ","))
    150157                                this->parseResult_ = PR_finished;
     
    156163                    {
    157164                        COUT(1) << std::endl;
    158                         COUT(1) << "An error occurred in XMLPort.h while loading attribute '" << this->paramname_ << "' of '" << object->getIdentifier()->getName() << "' (objectname: " << ((BaseObject*)object)->getName() << ") in " << ((BaseObject*)object)->getLevelfile() << ":" << std::endl;
     165                        COUT(1) << "An error occurred in XMLPort.h while loading attribute '" << this->paramname_ << "' of '" << this->identifier_->getName() << "' (objectname: " << ((BaseObject*)object)->getName() << ") in " << ((BaseObject*)object)->getLevelfile() << ":" << std::endl;
    159166                        COUT(1) << ex.what() << std::endl;
    160167                    }
  • code/branches/core3/src/orxonox/objects/Ambient.cc

    r1586 r1592  
    6464    }
    6565
    66     bool Ambient::create(){
    67       GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(ambientLight_);
    68       return Synchronisable::create();
     66    bool Ambient::create()
     67    {
     68        GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(ambientLight_);
     69        return Synchronisable::create();
    6970    }
    7071
    71     void Ambient::registerAllVariables(){
    72       registerVar(&ambientLight_, sizeof(ColourValue), network::DATA);
    73 
     72    void Ambient::registerAllVariables()
     73    {
     74        registerVar(&ambientLight_, sizeof(ColourValue), network::DATA);
    7475    }
    7576
    76     void Ambient::loadParams(TiXmlElement* xmlElem)
     77    void Ambient::setAmbientLight(const ColourValue& colour)
    7778    {
    78         if (xmlElem->Attribute("colourvalue"))
    79         {
    80         SubString colourvalues(xmlElem->Attribute("colourvalue"), ',');
    81 
    82                 float r, g, b;
    83         convertValue<std::string, float>(&r, colourvalues[0]);
    84         convertValue<std::string, float>(&g, colourvalues[1]);
    85         convertValue<std::string, float>(&b, colourvalues[2]);
    86 
    87                 this->setAmbientLight(ColourValue(r, g, b));
    88 
    89                 COUT(4) << "Loader: Set ambient light: "<<r<<" " << g << " " << b  << std::endl << std::endl;
    90         }
    91    }
    92 
    93    void Ambient::setAmbientLight(const ColourValue& colour)
    94    {
    95         GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour);
    96       ambientLight_=colour;
    97    }
     79        GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour);
     80        ambientLight_=colour;
     81    }
    9882
    9983    /**
     
    10791        BaseObject::XMLPort(xmlelement, mode);
    10892
    109         XMLPortParamLoadOnly(Ambient, "colourvalue", setAmbientLight, xmlelement, mode);
     93        XMLPortParam(Ambient, "colourvalue", setAmbientLight, getAmbienetLight, xmlelement, mode);
    11094        create();
    11195    }
  • code/branches/core3/src/orxonox/objects/Ambient.h

    r1505 r1592  
    4444            virtual ~Ambient();
    4545
    46             void loadParams(TiXmlElement* xmlElem);
    4746            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    48             void setAmbientLight(const ColourValue& colour);
    4947            virtual bool create();
    5048            void registerAllVariables();
     49
     50            void setAmbientLight(const ColourValue& colour);
     51            inline const ColourValue& getAmbienetLight() const
     52                { return this->ambientLight_; }
    5153
    5254            static void setAmbientLightTest(const ColourValue& colour)
  • code/branches/core3/src/orxonox/objects/Model.cc

    r1559 r1592  
    6868        WorldEntity::XMLPort(xmlelement, mode);
    6969
    70         XMLPortParamLoadOnly(Model, "mesh", setMesh, xmlelement, mode);
     70        XMLPortParam(Model, "mesh", setMesh, getMesh, xmlelement, mode);
    7171
    7272        Model::create();
    73     }
    74 
    75     void Model::setMesh(const std::string& meshname)
    76     {
    77         this->meshSrc_ = meshname;
    7873    }
    7974
  • code/branches/core3/src/orxonox/objects/Model.h

    r1558 r1592  
    4545            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    4646            virtual void changedVisibility();
    47             void setMesh(const std::string& meshname);
     47            inline void setMesh(const std::string& meshname)
     48                { this->meshSrc_ = meshname; }
     49            inline const std::string& getMesh() const
     50                { return this->meshSrc_; }
    4851            virtual bool create();
    4952
  • code/branches/core3/src/orxonox/objects/NPC.cc

    r1591 r1592  
    4646  NPC::~NPC()
    4747  {
    48   }
    49 
    50   void NPC::loadParams(TiXmlElement* xmlElem)
    51   {
    52     Model::loadParams(xmlElem);
    5348  }
    5449
  • code/branches/core3/src/orxonox/objects/NPC.h

    r1505 r1592  
    4848      NPC();
    4949      virtual ~NPC();
    50       virtual void loadParams(TiXmlElement* xmlElem);
    5150      void tick(float dt);
    5251      void update();
  • code/branches/core3/src/orxonox/objects/Projectile.cc

    r1591 r1592  
    9292            if ((*it) != this->owner_)
    9393            {
    94                 radius = it->getScale().x * 3.0;
     94                radius = it->getScale3D().x * 3.0;
    9595
    9696                if (this->getPosition().squaredDistance(it->getPosition()) <= (radius*radius))
  • code/branches/core3/src/orxonox/objects/Skybox.cc

    r1586 r1592  
    5959    }
    6060
    61     void Skybox::setSkyboxSrc(const std::string& src)
    62     {
    63         this->skyboxSrc_ = src;
    64     }
    65 
    6661    /**
    6762        @brief XML loading and saving.
     
    7469        BaseObject::XMLPort(xmlelement, mode);
    7570
    76         XMLPortParamLoadOnly(Skybox, "src", setSkyboxSrc, xmlelement, mode);
     71        XMLPortParam(Skybox, "src", setSkyboxSrc, getSkyboxSrc, xmlelement, mode);
    7772        create();
    7873    }
  • code/branches/core3/src/orxonox/objects/Skybox.h

    r1558 r1592  
    4949            virtual bool create();
    5050            void registerAllVariables();
    51             void setSkyboxSrc(const std::string &src);
     51
     52            inline void setSkyboxSrc(const std::string &src)
     53                { this->skyboxSrc_ = src; }
     54            inline const std::string& getSkyboxSrc() const
     55                { return this->skyboxSrc_; }
    5256
    5357        private:
  • code/branches/core3/src/orxonox/objects/SpaceShip.cc

    r1591 r1592  
    347347        Model::XMLPort(xmlelement, mode);
    348348
    349         XMLPortParamLoadOnly(SpaceShip, "camera", setCamera, xmlelement, mode);
    350         XMLPortParamLoadOnly(SpaceShip, "maxSpeed", setMaxSpeed, xmlelement, mode);
    351         XMLPortParamLoadOnly(SpaceShip, "maxSideAndBackSpeed", setMaxSideAndBackSpeed, xmlelement, mode);
    352         XMLPortParamLoadOnly(SpaceShip, "maxRotation", setMaxRotation, xmlelement, mode);
    353         XMLPortParamLoadOnly(SpaceShip, "transAcc", setTransAcc, xmlelement, mode);
    354         XMLPortParamLoadOnly(SpaceShip, "rotAcc", setRotAcc, xmlelement, mode);
    355         XMLPortParamLoadOnly(SpaceShip, "transDamp", setTransDamp, xmlelement, mode);
    356         XMLPortParamLoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, mode);
     349        XMLPortParam(SpaceShip, "camera", setCamera, getCamera, xmlelement, mode);
     350        XMLPortParam(SpaceShip, "maxSpeed", setMaxSpeed, getMaxSpeed, xmlelement, mode);
     351        XMLPortParam(SpaceShip, "maxSideAndBackSpeed", setMaxSideAndBackSpeed, getMaxSideAndBackSpeed, xmlelement, mode);
     352        XMLPortParam(SpaceShip, "maxRotation", setMaxRotation, getMaxRotation, xmlelement, mode);
     353        XMLPortParam(SpaceShip, "transAcc", setTransAcc, getTransAcc, xmlelement, mode);
     354        XMLPortParam(SpaceShip, "rotAcc", setRotAcc, getRotAcc, xmlelement, mode);
     355        XMLPortParam(SpaceShip, "transDamp", setTransDamp, getTransDamp, xmlelement, mode);
     356        XMLPortParam(SpaceShip, "rotDamp", setRotDamp, getRotDamp, xmlelement, mode);
    357357
    358358        SpaceShip::create();
  • code/branches/core3/src/orxonox/objects/WorldEntity.cc

    r1559 r1592  
    9595    }
    9696
    97     void WorldEntity::loadParams(TiXmlElement* xmlElem)
    98     {
    99 
    100         BaseObject::loadParams(xmlElem);
    101         create();
    102     }
    103 
    104 
    10597    void WorldEntity::setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll)
    10698    {
     
    120112        BaseObject::XMLPort(xmlelement, mode);
    121113
    122         XMLPortParam(WorldEntity, "position", setPositionLoader2, getPosition, xmlelement, mode);
    123         XMLPortParamLoadOnly(WorldEntity, "direction", setDirectionLoader, xmlelement, mode);
     114        XMLPortParamExternTemplate(Ogre::Node, this->node_, "position", setPosition, getPosition, xmlelement, mode, Ogre::Node, const Vector3&);
     115        XMLPortParamLoadOnly(WorldEntity, "direction", setDirectionSimple, xmlelement, mode);
    124116        XMLPortParamLoadOnly(WorldEntity, "yawpitchroll", setYawPitchRoll, xmlelement, mode);
    125         XMLPortParam(WorldEntity, "scale", setTotalScale, getScale, xmlelement, mode);
    126         XMLPortParam(WorldEntity, "rotationAxis", setRotationAxisLoader, getRotationAxis, xmlelement, mode);
     117        XMLPortParam(WorldEntity, "scale", setScale, getScale, xmlelement, mode);
     118        XMLPortParamTemplate(WorldEntity, "rotationAxis", setRotationAxis, getRotationAxis, xmlelement, mode, WorldEntity, const Vector3&);
    127119        XMLPortParam(WorldEntity, "rotationRate", setRotationRate, getRotationRate, xmlelement, mode);
    128120
     
    157149      registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA, 0x3);
    158150      // register scale of node
    159       registerVar( (void*) &(this->getScale().x), sizeof(this->getScale().x), network::DATA, 0x3);
    160       registerVar( (void*) &(this->getScale().y), sizeof(this->getScale().y), network::DATA, 0x3);
    161       registerVar( (void*) &(this->getScale().z), sizeof(this->getScale().z), network::DATA, 0x3);
     151      registerVar( (void*) &(this->getScale3D().x), sizeof(this->getScale3D().x), network::DATA, 0x3);
     152      registerVar( (void*) &(this->getScale3D().y), sizeof(this->getScale3D().y), network::DATA, 0x3);
     153      registerVar( (void*) &(this->getScale3D().z), sizeof(this->getScale3D().z), network::DATA, 0x3);
    162154      //register staticity
    163155      registerVar( (void*) &(this->bStatic_), sizeof(this->bStatic_), network::DATA, 0x3);
  • code/branches/core3/src/orxonox/objects/WorldEntity.h

    r1535 r1592  
    5151
    5252            virtual void tick(float dt);
    53             virtual void loadParams(TiXmlElement* xmlElem);
    5453            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5554            virtual inline bool create(){ return Synchronisable::create(); }
     
    6665            inline void setPosition(const Vector3& pos)
    6766                { this->node_->setPosition(pos); }
    68             inline void setPositionLoader1(const Vector3& pos)
    69                 { this->node_->setPosition(pos); }
    70             inline void setPositionLoader2(Real x, Real y, Real z)
    71                 { this->node_->setPosition(x, y, z); }
    7267            inline void setPosition(Real x, Real y, Real z)
    7368                { this->node_->setPosition(x, y, z); }
     
    105100            inline void rotate(const Vector3 &axis, const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
    106101              { this->node_->rotate(axis, angle, relativeTo); }
    107             inline void setDirectionLoader(Real x, Real y, Real z)
     102            inline void setDirectionSimple(Real x, Real y, Real z)
    108103              { this->setDirection(x, y, z); }
    109104            inline void setDirection(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
     
    114109              { this->node_->lookAt(targetPoint, relativeTo, localDirectionVector); }
    115110
    116             inline void setScale(const Vector3 &scale)
     111            inline void setScale3D(const Vector3 &scale)
    117112              { this->node_->setScale(scale); }
    118             inline void setScale(Real x, Real y, Real z)
     113            inline void setScale3D(Real x, Real y, Real z)
    119114              { this->node_->setScale(x, y, z); }
    120             inline void setScale(Real scale)
     115            inline const Vector3& getScale3D(void) const
     116              { return this->node_->getScale(); }
     117            inline void setScale(float scale)
    121118              { this->node_->setScale(scale, scale, scale); }
    122             inline void setTotalScale(Real scale)
    123               { this->node_->setScale(scale, scale, scale); }
    124             inline const Vector3& getScale(void) const
    125               { return this->node_->getScale(); }
    126             inline void scale(const Vector3 &scale)
     119            inline float getScale() const
     120              { Vector3 scale = this->getScale3D(); return (scale.x == scale.y && scale.x == scale.z) ? scale.x : 1; }
     121            inline void scale3D(const Vector3 &scale)
    127122              { this->node_->scale(scale); }
    128             inline void scale(Real x, Real y, Real z)
     123            inline void scale3D(Real x, Real y, Real z)
    129124              { this->node_->scale(x, y, z); }
    130125            inline void scale(Real scale)
     
    154149                { return this->acceleration_; }
    155150
    156             inline void setRotationAxisLoader(const Vector3& axis)
    157                 { this->rotationAxis_ = axis; rotationAxis_.normalise(); }
    158151            inline void setRotationAxis(const Vector3& axis)
    159                 { this->rotationAxis_ = axis; rotationAxis_.normalise(); }
     152                { this->rotationAxis_ = axis; this->rotationAxis_.normalise(); }
    160153            inline void setRotationAxis(Real x, Real y, Real z)
    161154                { this->rotationAxis_.x = x; this->rotationAxis_.y = y; this->rotationAxis_.z = z; rotationAxis_.normalise(); }
Note: See TracChangeset for help on using the changeset viewer.