Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 9, 2008, 4:44:36 PM (16 years ago)
Author:
landauf
Message:

merged core branch to trunk

Location:
code/trunk/src/orxonox/objects
Files:
32 edited
1 copied

Legend:

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

    r790 r871  
    4040#include "../core/CoreIncludes.h"
    4141#include "../Orxonox.h"
     42#include "core/XMLPort.h"
    4243
    4344#include "Ambient.h"
     
    4546namespace orxonox
    4647{
    47     // create a template instantiations
    48     //template class _OrxonoxExport ClassIdentifier<Ambient>;
    49 
    5048    CreateFactory(Ambient);
    5149
     
    6159    void Ambient::loadParams(TiXmlElement* xmlElem)
    6260    {
    63         Ogre::SceneManager* mgr = orxonox::Orxonox::getSingleton()->getSceneManager();
    64 
    6561        if (xmlElem->Attribute("colourvalue"))
    6662        {
     
    7268                String2Number<float>(b, colourvalues[2]);
    7369
    74                 mgr->setAmbientLight(ColourValue(r,g,b));
     70                this->setAmbientLight(ColourValue(r, g, b));
    7571
    7672                COUT(4) << "Loader: Set ambient light: "<<r<<" " << g << " " << b  << std::endl << std::endl;
    7773        }
    7874   }
     75
     76   void Ambient::setAmbientLight(const ColourValue& colour)
     77   {
     78        Orxonox::getSingleton()->getSceneManager()->setAmbientLight(colour);
     79   }
     80
     81    /**
     82        @brief XML loading and saving.
     83        @param xmlelement The XML-element
     84        @param loading Loading (true) or saving (false)
     85        @return The XML-element
     86    */
     87    void Ambient::XMLPort(Element& xmlelement, bool loading)
     88    {
     89        BaseObject::XMLPort(xmlelement, loading);
     90
     91        XMLPortParamLoadOnly(Ambient, "colourvalue", setAmbientLight, xmlelement, loading);
     92    }
    7993}
  • code/trunk/src/orxonox/objects/Ambient.h

    r790 r871  
    1414            virtual ~Ambient();
    1515
    16            
    1716            void loadParams(TiXmlElement* xmlElem);
     17            virtual void XMLPort(Element& xmlelement, bool loading);
     18            void setAmbientLight(const ColourValue& colour);
    1819
    1920        private:
    20            
     21
    2122
    2223    };
    23     ExportClass(Ambient, Orxonox);
    2424}
    2525
  • code/trunk/src/orxonox/objects/Camera.h

    r790 r871  
    1414            virtual ~Camera();
    1515
    16            
     16
    1717            void loadParams(TiXmlElement* xmlElem);
    1818
    1919        private:
    20            
     20
    2121
    2222    };
    23     ExportClass(Camera, Orxonox);
    2423}
    2524
  • code/trunk/src/orxonox/objects/Explosion.h

    r790 r871  
    2121            ParticleInterface* particle_;
    2222    };
    23     ExportClass(Explosion, Orxonox);
    2423}
    2524
  • code/trunk/src/orxonox/objects/Fighter.h

    r790 r871  
    9090            int emitterRate_;
    9191    };
    92     ExportClass(Fighter, Orxonox);
    9392}
    9493
  • code/trunk/src/orxonox/objects/Model.cc

    r790 r871  
    3333#include "../core/CoreIncludes.h"
    3434#include "../Orxonox.h"
     35#include "core/XMLPort.h"
    3536
    3637#include "Model.h"
     
    6061    }
    6162
     63    /**
     64        @brief XML loading and saving.
     65        @param xmlelement The XML-element
     66        @param loading Loading (true) or saving (false)
     67        @return The XML-element
     68    */
     69    void Model::XMLPort(Element& xmlelement, bool loading)
     70    {
     71        WorldEntity::XMLPort(xmlelement, loading);
     72
     73        XMLPortParamLoadOnly(Model, "mesh", setMesh, xmlelement, loading);
     74
     75        create();
     76    }
     77
     78    void Model::setMesh(const std::string& meshname)
     79    {
     80        this->meshSrc_ = meshname;
     81    }
     82
    6283    bool Model::create(){
    6384      if(meshSrc_.compare("")!=0){
     
    7192
    7293    void Model::registerAllVariables(){
    73       registerVar(&meshSrc_, meshSrc_.length() + 1, network::STRING);
     94//      registerVar(&meshSrc_, meshSrc_.length() + 1, network::STRING);
    7495    }
    7596}
  • code/trunk/src/orxonox/objects/Model.h

    r790 r871  
    1818            virtual ~Model();
    1919            virtual void loadParams(TiXmlElement* xmlElem);
     20            virtual void XMLPort(Element& xmlelement, bool loading);
     21            void setMesh(const std::string& meshname);
    2022            bool create();
    2123
     
    2527            void registerAllVariables();
    2628    };
    27     ExportClass(Model, Orxonox);
    2829}
    2930
  • code/trunk/src/orxonox/objects/NPC.h

    r790 r871  
    4444      static int const NUMELEMENTS = 9;  //number of elements
    4545  };
    46   ExportClass(NPC, Orxonox);
    47 
    4846}
    4947#endif /* _NPC_H__ */
  • code/trunk/src/orxonox/objects/Projectile.h

    r790 r871  
    2828            Timer<Projectile> destroyTimer_;
    2929    };
    30     ExportClass(Projectile, Orxonox);
    3130}
    3231
  • code/trunk/src/orxonox/objects/Skybox.cc

    r790 r871  
    3838#include "../core/CoreIncludes.h"
    3939#include "../core/Debug.h"
     40#include "core/XMLPort.h"
    4041
    4142#include "Skybox.h"
     
    5657    void Skybox::loadParams(TiXmlElement* xmlElem)
    5758    {
    58         Ogre::SceneManager* mgr = orxonox::Orxonox::getSingleton()->getSceneManager();
    59 
    6059        if (xmlElem->Attribute("src"))
    6160        {
    6261                std::string skyboxSrc = xmlElem->Attribute("src");
    63                 mgr->setSkyBox(true, skyboxSrc);
     62                this->setSkybox(skyboxSrc);
    6463
    6564                COUT(4) << "Loader: Set skybox: "<< skyboxSrc << std::endl << std::endl;
    6665        }
    6766   }
     67
     68   void Skybox::setSkybox(const std::string& skyboxname)
     69   {
     70        Orxonox::getSingleton()->getSceneManager()->setSkyBox(true, skyboxname);
     71   }
     72
     73    /**
     74        @brief XML loading and saving.
     75        @param xmlelement The XML-element
     76        @param loading Loading (true) or saving (false)
     77        @return The XML-element
     78    */
     79    void Skybox::XMLPort(Element& xmlelement, bool loading)
     80    {
     81        BaseObject::XMLPort(xmlelement, loading);
     82
     83        XMLPortParamLoadOnly(Skybox, "src", setSkybox, xmlelement, loading);
     84    }
    6885}
  • code/trunk/src/orxonox/objects/Skybox.h

    r790 r871  
    1616            virtual ~Skybox();
    1717
    18            
    1918            void loadParams(TiXmlElement* xmlElem);
     19            virtual void XMLPort(Element& xmlelement, bool loading);
     20            void setSkybox(const std::string& skyboxname);
    2021
    2122        private:
    22            
     23
    2324
    2425    };
    25     ExportClass(Skybox, Orxonox);
    2626}
    2727
  • code/trunk/src/orxonox/objects/SpaceShip.cc

    r790 r871  
    4444#include "../particle/ParticleInterface.h"
    4545#include "Projectile.h"
     46#include "core/XMLPort.h"
    4647
    4748#include "SpaceShip.h"
     
    123124        this->brakeLoop(loop);
    124125*/
     126        this->init();
     127
    125128        COUT(3) << "Info: SpaceShip was loaded" << std::endl;
    126129    }
     
    132135    }
    133136
    134     void SpaceShip::setConfigValues()
    135     {
    136         SetConfigValue(bInvertYAxis_, false).description("Set this to true for joystick-like mouse behaviour (mouse up = ship down).");
    137         SetConfigValue(reloadTime_, 0.125).description("The reload time of the weapon in seconds");
    138         SetConfigValue(testvector_, Vector3()).description("asdfblah");
    139     }
    140 
    141     void SpaceShip::loadParams(TiXmlElement* xmlElem)
    142     {
    143         Model::loadParams(xmlElem);
    144 
    145 
     137    void SpaceShip::init()
     138    {
    146139        // START CREATING THRUSTER
    147140        this->tt_ = new ParticleInterface(Orxonox::getSingleton()->getSceneManager(),"twinthruster" + this->getName(),"Orxonox/engineglow");
     
    197190
    198191        // END of testing crosshair
    199 
     192    }
     193
     194    void SpaceShip::setConfigValues()
     195    {
     196        SetConfigValue(bInvertYAxis_, false).description("Set this to true for joystick-like mouse behaviour (mouse up = ship down).");
     197        SetConfigValue(reloadTime_, 0.125).description("The reload time of the weapon in seconds");
     198        SetConfigValue(testvector_, Vector3()).description("asdfblah");
     199    }
     200
     201    void SpaceShip::loadParams(TiXmlElement* xmlElem)
     202    {
     203        Model::loadParams(xmlElem);
    200204/*
    201205        if (xmlElem->Attribute("forward") && xmlElem->Attribute("rotateupdown") && xmlElem->Attribute("rotaterightleft") && xmlElem->Attribute("looprightleft"))
     
    242246        if (xmlElem->Attribute("camera"))
    243247        {
    244             Ogre::Camera *cam = Orxonox::getSingleton()->getSceneManager()->createCamera("ShipCam");
    245             this->camNode_ = this->getNode()->createChildSceneNode("CamNode");
    246 /*
    247 //            node->setInheritOrientation(false);
    248             cam->setPosition(Vector3(0,50,-150));
    249             cam->lookAt(Vector3(0,20,0));
    250             cam->roll(Degree(0));
    251 */
    252 
    253             cam->setPosition(Vector3(-200,0,35));
    254 //            cam->setPosition(Vector3(0,-350,0));
    255             cam->lookAt(Vector3(0,0,35));
    256             cam->roll(Degree(-90));
    257 
    258             this->camNode_->attachObject(cam);
    259             Orxonox::getSingleton()->getOgrePointer()->getRoot()->getAutoCreatedWindow()->addViewport(cam);
     248            this->setCamera();
    260249        }
     250    }
     251
     252    void SpaceShip::setCamera(const std::string& camera)
     253    {
     254        Ogre::Camera *cam = Orxonox::getSingleton()->getSceneManager()->createCamera("ShipCam");
     255        this->camNode_ = this->getNode()->createChildSceneNode("CamNode");
     256/*
     257//        node->setInheritOrientation(false);
     258        cam->setPosition(Vector3(0,50,-150));
     259        cam->lookAt(Vector3(0,20,0));
     260        cam->roll(Degree(0));
     261*/
     262
     263        cam->setPosition(Vector3(-200,0,35));
     264//        cam->setPosition(Vector3(0,-350,0));
     265        cam->lookAt(Vector3(0,0,35));
     266        cam->roll(Degree(-90));
     267
     268        this->camNode_->attachObject(cam);
     269        Orxonox::getSingleton()->getOgrePointer()->getRoot()->getAutoCreatedWindow()->addViewport(cam);
     270    }
     271
     272    void SpaceShip::setMaxSpeed(float value)
     273    { this->maxSpeed_ = value; }
     274    void SpaceShip::setMaxSideAndBackSpeed(float value)
     275    { this->maxSideAndBackSpeed_ = value; }
     276    void SpaceShip::setMaxRotation(float value)
     277    { this->maxRotation_ = value; this->maxRotationRadian_ = Radian(value); }
     278    void SpaceShip::setTransAcc(float value)
     279    { this->translationAcceleration_ = value; }
     280    void SpaceShip::setRotAcc(float value)
     281    { this->rotationAcceleration_ = value; this->rotationAccelerationRadian_ = Radian(value); }
     282    void SpaceShip::setTransDamp(float value)
     283    { this->translationDamping_ = value; }
     284    void SpaceShip::setRotDamp(float value)
     285    { this->rotationDamping_ = value; this->rotationDampingRadian_ = Radian(value); }
     286
     287    /**
     288        @brief XML loading and saving.
     289        @param xmlelement The XML-element
     290        @param loading Loading (true) or saving (false)
     291        @return The XML-element
     292    */
     293    void SpaceShip::XMLPort(Element& xmlelement, bool loading)
     294    {
     295        Model::XMLPort(xmlelement, loading);
     296
     297        XMLPortParamLoadOnly(SpaceShip, "camera", setCamera, xmlelement, loading);
     298        XMLPortParamLoadOnly(SpaceShip, "maxSpeed", setMaxSpeed, xmlelement, loading);
     299        XMLPortParamLoadOnly(SpaceShip, "maxSideAndBackSpeed", setMaxSideAndBackSpeed, xmlelement, loading);
     300        XMLPortParamLoadOnly(SpaceShip, "maxRotation", setMaxRotation, xmlelement, loading);
     301        XMLPortParamLoadOnly(SpaceShip, "transAcc", setTransAcc, xmlelement, loading);
     302        XMLPortParamLoadOnly(SpaceShip, "rotAcc", setRotAcc, xmlelement, loading);
     303        XMLPortParamLoadOnly(SpaceShip, "transDamp", setTransDamp, xmlelement, loading);
     304        XMLPortParamLoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, loading);
    261305    }
    262306
  • code/trunk/src/orxonox/objects/SpaceShip.h

    r790 r871  
    2121            SpaceShip();
    2222            ~SpaceShip();
     23            void init();
    2324            void setConfigValues();
    2425            virtual void loadParams(TiXmlElement* xmlElem);
     26            virtual void XMLPort(Element& xmlelement, bool loading);
    2527            virtual void tick(float dt);
     28
     29            void setCamera(const std::string& camera = "");
     30            void setMaxSpeed(float value);
     31            void setMaxSideAndBackSpeed(float value);
     32            void setMaxRotation(float value);
     33            void setTransAcc(float value);
     34            void setRotAcc(float value);
     35            void setTransDamp(float value);
     36            void setRotDamp(float value);
    2637
    2738            bool mouseMoved(const OIS::MouseEvent &e);
     
    7586            int emitterRate_;
    7687    };
    77     ExportClass(SpaceShip, Orxonox);
    7888}
    7989
  • code/trunk/src/orxonox/objects/SpaceshipSteeringObject.cc

    r790 r871  
    4040#include "util/Tokenizer.h"
    4141#include "util/String2Number.h"
    42 #include "../core/Debug.h"
    43 
     42#include "core/CoreIncludes.h"
    4443#include "SpaceshipSteeringObject.h"
    4544
  • code/trunk/src/orxonox/objects/Test.h

    r790 r871  
    3030
    3131#include "core/BaseObject.h"
    32 #include "../core/CoreIncludes.h"
    3332
    3433namespace orxonox
     
    7473        public:
    7574            A1B2() { RegisterObject(A1B2); }
     75//            virtual void test() = 0;
    7676    };
    7777
     
    116116        public:
    117117            A1B2C1() { RegisterObject(A1B2C1); }
     118//            void test() { std::cout << "test!\n"; }
    118119    };
    119120
  • code/trunk/src/orxonox/objects/Tickable.h

    r790 r871  
    4444
    4545#include "../OrxonoxPrereqs.h"
    46 
    47 #include "../core/CoreIncludes.h"
     46#include "core/OrxonoxClass.h"
    4847
    4948namespace orxonox
     
    6261
    6362        protected:
    64             /**
    65                 @brief Constructor: Registers the object in the Tickable-list
    66             */
    67             Tickable() { RegisterRootObject(Tickable); }
     63            Tickable();
    6864    };
    69     ExportAbstractClass(Tickable, Orxonox);
    7065
    7166    //! The TickFrameListener calls the tick(dt) function of all Tickables every frame.
  • code/trunk/src/orxonox/objects/WorldEntity.cc

    r790 r871  
    3737#include "../Orxonox.h"
    3838#include "WorldEntity.h"
     39#include "core/XMLPort.h"
    3940
    4041namespace orxonox
     
    8687    void WorldEntity::loadParams(TiXmlElement* xmlElem)
    8788    {
     89
    8890        BaseObject::loadParams(xmlElem);
    89 
     91/*
    9092        if (xmlElem->Attribute("position"))
    9193        {
     
    153155
    154156        create();
    155 
     157*/
     158    }
     159
     160    void WorldEntity::setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll)
     161    {
     162        this->yaw(yaw);
     163        this->pitch(pitch);
     164        this->roll(roll);
     165    }
     166
     167    /**
     168        @brief XML loading and saving.
     169        @param xmlelement The XML-element
     170        @param loading Loading (true) or saving (false)
     171        @return The XML-element
     172    */
     173    void WorldEntity::XMLPort(Element& xmlelement, bool loading)
     174    {
     175        BaseObject::XMLPort(xmlelement, loading);
     176
     177        XMLPortParam(WorldEntity, "position", setPositionLoader2, getPosition, xmlelement, loading);
     178        XMLPortParamLoadOnly(WorldEntity, "direction", setDirectionLoader, xmlelement, loading);
     179        XMLPortParamLoadOnly(WorldEntity, "yawpitchroll", setYawPitchRoll, xmlelement, loading);
     180        XMLPortParam(WorldEntity, "scale", setTotalScale, getScale, xmlelement, loading);
     181        XMLPortParam(WorldEntity, "rotationAxis", setRotationAxisLoader, getRotationAxis, xmlelement, loading);
     182        XMLPortParam(WorldEntity, "rotationRate", setRotationRate, getRotationRate, xmlelement, loading);
     183
     184        XMLPortObject(WorldEntity, WorldEntity, "attached", attachWorldEntity, getAttachedWorldEntity, xmlelement, loading);
    156185    }
    157186
     
    163192    void WorldEntity::registerAllVariables()
    164193    {
    165       // register coordinates
     194/*      // register coordinates
    166195      registerVar( (void*) &(this->getPosition().x), sizeof(this->getPosition().x), network::DATA);
    167196      registerVar( (void*) &(this->getPosition().y), sizeof(this->getPosition().y), network::DATA);
     
    171200      registerVar( (void*) &(this->getOrientation().x), sizeof(this->getOrientation().x), network::DATA);
    172201      registerVar( (void*) &(this->getOrientation().y), sizeof(this->getOrientation().y), network::DATA);
    173       registerVar( (void*) &(this->getOrientation().z), sizeof(this->getOrientation().z), network::DATA);
     202      registerVar( (void*) &(this->getOrientation().z), sizeof(this->getOrientation().z), network::DATA);*/
    174203      // not needed at the moment, because we don't have prediction yet
    175204      /*// register velocity_
     
    183212      registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA);*/
    184213    }
     214
     215    void WorldEntity::attachWorldEntity(WorldEntity* entity)
     216    {
     217        this->attachedWorldEntities_.push_back(entity);
     218    }
     219
     220    const WorldEntity* WorldEntity::getAttachedWorldEntity(unsigned int index)
     221    {
     222        if (index < this->attachedWorldEntities_.size())
     223            return this->attachedWorldEntities_[index];
     224        else
     225            return 0;
     226    }
    185227}
  • code/trunk/src/orxonox/objects/WorldEntity.h

    r790 r871  
    88
    99#include "util/Math.h"
     10#include "util/XMLIncludes.h"
    1011#include "network/Synchronisable.h"
    11 #include "util/tinyxml/tinyxml.h"
    12 #include "../core/CoreIncludes.h"
     12//#include "util/tinyxml/tinyxml.h"
    1313#include "core/BaseObject.h"
    1414#include "Tickable.h"
     
    1717namespace orxonox
    1818{
    19   class _OrxonoxExport WorldEntity : public BaseObject, public Tickable, public network::Synchronisable
    20   {
    21     public:
    22       WorldEntity();
    23       virtual ~WorldEntity();
     19    class _OrxonoxExport WorldEntity : public BaseObject, public Tickable//, public network::Synchronisable
     20    {
     21        public:
     22            WorldEntity();
     23            virtual ~WorldEntity();
    2424
    25       virtual void tick(float dt);
    26       virtual void loadParams(TiXmlElement* xmlElem);
    27       bool create();
     25            virtual void tick(float dt);
     26            virtual void loadParams(TiXmlElement* xmlElem);
     27            virtual void XMLPort(Element& xmlelement, bool loading);
     28            bool create();
    2829
    29       inline Ogre::SceneNode* getNode()
    30           { return this->node_; }
     30            void attachWorldEntity(WorldEntity* entity);
     31            const WorldEntity* getAttachedWorldEntity(unsigned int index);
    3132
    32       inline void setNode(Ogre::SceneNode* node)
    33           { this->node_ = node; }
     33            inline Ogre::SceneNode* getNode()
     34                { return this->node_; }
    3435
    35       inline void setPosition(const Vector3& pos)
    36           { this->node_->setPosition(pos); }
    37       inline void setPosition(Real x, Real y, Real z)
    38           { this->node_->setPosition(x, y, z); }
    39       inline const Vector3& getPosition() const
    40           { return this->node_->getPosition(); }
     36            inline void setNode(Ogre::SceneNode* node)
     37                { this->node_ = node; }
    4138
    42       inline void translate(const Vector3 &d, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
    43           { this->node_->translate(d, relativeTo); }
    44       inline void translate(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
    45           { this->node_->translate(x, y, z, relativeTo); }
    46       inline void translate(const Matrix3 &axes, const Vector3 &move, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
    47           { this->node_->translate(axes, move, relativeTo); }
    48       inline void translate(const Matrix3 &axes, Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
    49           { this->node_->translate(axes, x, y, z, relativeTo); }
     39            inline void setPosition(const Vector3& pos)
     40                { this->node_->setPosition(pos); }
     41            inline void setPositionLoader1(const Vector3& pos)
     42                { this->node_->setPosition(pos); }
     43            inline void setPositionLoader2(Real x, Real y, Real z)
     44                { this->node_->setPosition(x, y, z); }
     45            inline void setPosition(Real x, Real y, Real z)
     46                { this->node_->setPosition(x, y, z); }
     47            inline const Vector3& getPosition() const
     48                { return this->node_->getPosition(); }
    5049
    51       inline void yaw(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
    52           { this->node_->yaw(angle, relativeTo); }
    53       inline void pitch(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
    54           { this->node_->pitch(angle, relativeTo); }
    55       inline void roll(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
    56           { this->node_->roll(angle, relativeTo); }
     50            inline void translate(const Vector3 &d, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
     51                { this->node_->translate(d, relativeTo); }
     52            inline void translate(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
     53                { this->node_->translate(x, y, z, relativeTo); }
     54            inline void translate(const Matrix3 &axes, const Vector3 &move, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
     55                { this->node_->translate(axes, move, relativeTo); }
     56            inline void translate(const Matrix3 &axes, Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
     57                { this->node_->translate(axes, x, y, z, relativeTo); }
    5758
    58       inline const Ogre::Quaternion& getOrientation()
    59         { return this->node_->getOrientation(); }
    60       inline void setOrientation(const Ogre::Quaternion& quat)
    61         { this->node_->setOrientation(quat); }
    62       inline void rotate(const Vector3 &axis, const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
    63         { this->node_->rotate(axis, angle, relativeTo); }
    64       inline void setDirection(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
    65         { this->node_->setDirection(x, y, z, relativeTo, localDirectionVector); }
    66       inline void setDirection(const Vector3 &vec, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
    67         { this->node_->setDirection(vec, relativeTo, localDirectionVector); }
    68       inline void lookAt(const Vector3 &targetPoint, Ogre::Node::TransformSpace relativeTo, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
    69         { this->node_->lookAt(targetPoint, relativeTo, localDirectionVector); }
     59            inline void yaw(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
     60                { this->node_->yaw(angle, relativeTo); }
     61            inline void pitch(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
     62                { this->node_->pitch(angle, relativeTo); }
     63            inline void roll(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
     64                { this->node_->roll(angle, relativeTo); }
     65            void setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll);
    7066
    71       inline void setScale(const Vector3 &scale)
    72         { this->node_->setScale(scale); }
    73       inline void setScale(Real x, Real y, Real z)
    74         { this->node_->setScale(x, y, z); }
    75       inline void setScale(Real scale)
    76         { this->node_->setScale(scale, scale, scale); }
    77       inline const Vector3& getScale(void) const
    78         { return this->node_->getScale(); }
    79       inline void scale(const Vector3 &scale)
    80         { this->node_->scale(scale); }
    81       inline void scale(Real x, Real y, Real z)
    82         { this->node_->scale(x, y, z); }
    83       inline void scale(Real scale)
    84         { this->node_->scale(scale, scale, scale); }
     67            inline void setYaw(const Degree &angle)
     68                { this->node_->yaw(angle, Ogre::Node::TS_LOCAL); }
     69            inline void setPitch(const Degree &angle)
     70                { this->node_->pitch(angle, Ogre::Node::TS_LOCAL); }
     71            inline void setRoll(const Degree &angle)
     72                { this->node_->roll(angle, Ogre::Node::TS_LOCAL); }
    8573
    86       inline void attachObject(Ogre::MovableObject *obj)
    87         { this->node_->attachObject(obj); }
    88       inline void attachObject(Mesh &mesh)
    89         { this->node_->attachObject(mesh.getEntity()); }
    90       inline void detachObject(Ogre::MovableObject *obj)
    91         { this->node_->detachObject(obj); }
    92       inline void detachAllObjects()
    93         { this->node_->detachAllObjects(); }
     74            inline const Ogre::Quaternion& getOrientation()
     75              { return this->node_->getOrientation(); }
     76            inline void setOrientation(const Ogre::Quaternion& quat)
     77              { this->node_->setOrientation(quat); }
     78            inline void rotate(const Vector3 &axis, const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
     79              { this->node_->rotate(axis, angle, relativeTo); }
     80            inline void setDirectionLoader(Real x, Real y, Real z)
     81              { this->setDirection(x, y, z); }
     82            inline void setDirection(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
     83              { this->node_->setDirection(x, y, z, relativeTo, localDirectionVector); }
     84            inline void setDirection(const Vector3 &vec, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
     85              { this->node_->setDirection(vec, relativeTo, localDirectionVector); }
     86            inline void lookAt(const Vector3 &targetPoint, Ogre::Node::TransformSpace relativeTo, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
     87              { this->node_->lookAt(targetPoint, relativeTo, localDirectionVector); }
    9488
    95       inline void setVelocity(const Vector3& velocity)
    96           { this->velocity_ = velocity; }
    97       inline void setVelocity(Real x, Real y, Real z)
    98           { this->velocity_.x = x; this->velocity_.y = y; this->velocity_.z = z; }
    99       inline const Vector3& getVelocity() const
    100           { return this->velocity_; }
     89            inline void setScale(const Vector3 &scale)
     90              { this->node_->setScale(scale); }
     91            inline void setScale(Real x, Real y, Real z)
     92              { this->node_->setScale(x, y, z); }
     93            inline void setScale(Real scale)
     94              { this->node_->setScale(scale, scale, scale); }
     95            inline void setTotalScale(Real scale)
     96              { this->node_->setScale(scale, scale, scale); }
     97            inline const Vector3& getScale(void) const
     98              { return this->node_->getScale(); }
     99            inline void scale(const Vector3 &scale)
     100              { this->node_->scale(scale); }
     101            inline void scale(Real x, Real y, Real z)
     102              { this->node_->scale(x, y, z); }
     103            inline void scale(Real scale)
     104              { this->node_->scale(scale, scale, scale); }
    101105
    102       inline void setAcceleration(const Vector3& acceleration)
    103           { this->acceleration_ = acceleration; }
    104       inline void setAcceleration(Real x, Real y, Real z)
    105           { this->acceleration_.x = x; this->acceleration_.y = y; this->acceleration_.z = z; }
    106       inline const Vector3& getAcceleration() const
    107           { return this->acceleration_; }
     106            inline void attachObject(Ogre::MovableObject *obj)
     107              { this->node_->attachObject(obj); }
     108            inline void attachObject(Mesh &mesh)
     109              { this->node_->attachObject(mesh.getEntity()); }
     110            inline void detachObject(Ogre::MovableObject *obj)
     111              { this->node_->detachObject(obj); }
     112            inline void detachAllObjects()
     113              { this->node_->detachAllObjects(); }
    108114
    109       inline void setRotationAxis(const Vector3& axis)
    110           { this->rotationAxis_ = axis; }
    111       inline void setRotationAxis(Real x, Real y, Real z)
    112           { this->rotationAxis_.x = x; this->rotationAxis_.y = y; this->rotationAxis_.z = z; }
    113       inline const Vector3& getRotationAxis() const
    114           { return this->rotationAxis_; }
     115            inline void setVelocity(const Vector3& velocity)
     116                { this->velocity_ = velocity; }
     117            inline void setVelocity(Real x, Real y, Real z)
     118                { this->velocity_.x = x; this->velocity_.y = y; this->velocity_.z = z; }
     119            inline const Vector3& getVelocity() const
     120                { return this->velocity_; }
    115121
    116       inline void setRotationRate(const Radian& angle)
    117           { this->rotationRate_ = angle; }
    118       inline void setRotationRate(const Degree& angle)
    119           { this->rotationRate_ = angle; }
    120       inline const Radian& getRotationRate() const
    121           { return this->rotationRate_; }
     122            inline void setAcceleration(const Vector3& acceleration)
     123                { this->acceleration_ = acceleration; }
     124            inline void setAcceleration(Real x, Real y, Real z)
     125                { this->acceleration_.x = x; this->acceleration_.y = y; this->acceleration_.z = z; }
     126            inline const Vector3& getAcceleration() const
     127                { return this->acceleration_; }
    122128
    123       inline void setMomentum(const Radian& angle)
    124           { this->momentum_ = angle; }
    125       inline void setMomentum(const Degree& angle)
    126           { this->momentum_ = angle; }
    127       inline const Radian& getMomentum() const
    128           { return this->momentum_; }
     129            inline void setRotationAxisLoader(const Vector3& axis)
     130                { this->rotationAxis_ = axis; }
     131            inline void setRotationAxis(const Vector3& axis)
     132                { this->rotationAxis_ = axis; }
     133            inline void setRotationAxis(Real x, Real y, Real z)
     134                { this->rotationAxis_.x = x; this->rotationAxis_.y = y; this->rotationAxis_.z = z; }
     135            inline const Vector3& getRotationAxis() const
     136                { return this->rotationAxis_; }
    129137
    130       inline void setStatic(bool bStatic)
    131           { this->bStatic_ = bStatic; }
    132       inline bool isStatic()
    133           { return this->bStatic_; }
     138//            inline void setRotationRate(const Radian& angle)
     139//                { this->rotationRate_ = angle; }
     140            inline void setRotationRate(const Degree& angle)
     141                { this->rotationRate_ = angle; this->setStatic(angle == Degree(0)); }
     142            inline const Radian& getRotationRate() const
     143                { return this->rotationRate_; }
    134144
    135     protected:
    136       void registerAllVariables();
     145            inline void setMomentum(const Radian& angle)
     146                { this->momentum_ = angle; }
     147            inline void setMomentum(const Degree& angle)
     148                { this->momentum_ = angle; }
     149            inline const Radian& getMomentum() const
     150                { return this->momentum_; }
    137151
    138       Vector3 velocity_;
    139       Vector3 acceleration_;
    140       Vector3 rotationAxis_;
    141       Radian rotationRate_;
    142       Radian momentum_;
     152            inline void setStatic(bool bStatic)
     153                { this->bStatic_ = bStatic; }
     154            inline bool isStatic()
     155                { return this->bStatic_; }
    143156
    144     private:
    145       static unsigned int worldEntityCounter_s;
    146       Ogre::SceneNode* node_;
    147       bool bStatic_;
    148   };
    149   ExportClass(WorldEntity, Orxonox);
     157        protected:
     158            void registerAllVariables();
     159
     160            Vector3 velocity_;
     161            Vector3 acceleration_;
     162            Vector3 rotationAxis_;
     163            Radian rotationRate_;
     164            Radian momentum_;
     165
     166        private:
     167            static unsigned int worldEntityCounter_s;
     168            Ogre::SceneNode* node_;
     169            bool bStatic_;
     170            std::vector<WorldEntity*> attachedWorldEntities_;
     171    };
    150172}
    151173
  • code/trunk/src/orxonox/objects/test1.cc

    r790 r871  
    2929#include "test2.h"
    3030#include "test3.h"
    31 #include "util/tinyxml/tinyxml.h"
    32 #include "../Orxonox.h"
    33 #include <OgreSceneManager.h>
     31#include "core/CoreIncludes.h"
    3432
    3533namespace orxonox
  • code/trunk/src/orxonox/objects/test2.cc

    r790 r871  
    2929#include "test2.h"
    3030#include "test3.h"
     31#include "core/CoreIncludes.h"
    3132
    3233namespace orxonox
  • code/trunk/src/orxonox/objects/test3.cc

    r790 r871  
    2929#include "test2.h"
    3030#include "test3.h"
     31#include "core/CoreIncludes.h"
    3132
    3233namespace orxonox
     
    6364    void Test3::configOutput()
    6465    {
    65         std::cout << this->value_int_ << std::endl;
    66         std::cout << this->value_uint_ << std::endl;
    67         std::cout << (int)this->value_char_ << std::endl;
    68         std::cout << (int)this->value_uchar_ << std::endl;
    69         std::cout << this->value_float_ << std::endl;
    70         std::cout << this->value_double_ << std::endl;
    71         std::cout << this->value_bool_ << std::endl;
    72         std::cout << this->value_string_ << std::endl;
    73         std::cout << this->value_constchar_ << std::endl;
    74         std::cout << this->value_vector2_ << std::endl;
    75         std::cout << this->value_vector3_ << std::endl;
    76         std::cout << this->value_colourvalue_ << std::endl;
     66        std::cout << "int:         " << this->value_int_ << std::endl;
     67        std::cout << "uint:        " << this->value_uint_ << std::endl;
     68        std::cout << "char:        " << (int)this->value_char_ << std::endl;
     69        std::cout << "uchar:       " << (int)this->value_uchar_ << std::endl;
     70        std::cout << "float:       " << this->value_float_ << std::endl;
     71        std::cout << "double:      " << this->value_double_ << std::endl;
     72        std::cout << "bool:        " << this->value_bool_ << std::endl;
     73        std::cout << "string:      " << this->value_string_ << std::endl;
     74        std::cout << "constchar:   " << this->value_constchar_ << std::endl;
     75        std::cout << "vector2:     " << this->value_vector2_ << std::endl;
     76        std::cout << "vector3:     " << this->value_vector3_ << std::endl;
     77        std::cout << "colourvalue: " << this->value_colourvalue_ << std::endl;
    7778    }
    7879
  • code/trunk/src/orxonox/objects/test3.h

    r790 r871  
    33
    44#include "core/BaseObject.h"
     5#include "util/Math.h"
    56
    67namespace orxonox
  • code/trunk/src/orxonox/objects/weapon/AmmunitionDump.cc

    r790 r871  
    3131#include "BulletManager.h"
    3232#include "util/tinyxml/tinyxml.h"
     33#include "core/CoreIncludes.h"
    3334
    3435#include "AmmunitionDump.h"
  • code/trunk/src/orxonox/objects/weapon/AmmunitionDump.h

    r790 r871  
    3737
    3838#include "network/Synchronisable.h"
    39 //#include "../core/CoreIncludes.h"
    4039#include "core/BaseObject.h"
    4140
     
    6665    int *capacity_;
    6766  };
    68   ExportClass(AmmunitionDump, Orxonox);
    6967}
    7068
  • code/trunk/src/orxonox/objects/weapon/BarrelGun.cc

    r790 r871  
    3838#include "AmmunitionDump.h"
    3939#include "BaseWeapon.h"
     40#include "core/CoreIncludes.h"
    4041
    4142#include "BarrelGun.h"
  • code/trunk/src/orxonox/objects/weapon/BarrelGun.h

    r790 r871  
    6060
    6161  };
    62   ExportClass(BarrelGun, Orxonox);
    6362}
    6463
  • code/trunk/src/orxonox/objects/weapon/BaseWeapon.cc

    r790 r871  
    3838#include "BulletManager.h"
    3939#include "AmmunitionDump.h"
     40#include "core/CoreIncludes.h"
    4041
    4142#include "BaseWeapon.h"
  • code/trunk/src/orxonox/objects/weapon/BaseWeapon.h

    r790 r871  
    122122
    123123  };
    124   ExportAbstractClass(BaseWeapon, Orxonox);
    125124}
    126125
  • code/trunk/src/orxonox/objects/weapon/Bullet.cc

    r790 r871  
    2727
    2828#include "OrxonoxStableHeaders.h"
     29#include "core/CoreIncludes.h"
    2930
    3031#include "Bullet.h"
  • code/trunk/src/orxonox/objects/weapon/Bullet.h

    r790 r871  
    4747    inline virtual void loadParams(TiXmlElement* xmlElem) { Model::loadParams(xmlElem); };
    4848 };
    49   ExportClass(Bullet, Orxonox);
    5049}
    5150
  • code/trunk/src/orxonox/objects/weapon/BulletManager.cc

    r790 r871  
    3030#include "BulletManager.h"
    3131#include "Bullet.h"
     32#include "core/CoreIncludes.h"
    3233
    3334
  • code/trunk/src/orxonox/objects/weapon/BulletManager.h

    r790 r871  
    3838#include "network/Synchronisable.h"
    3939#include "util/tinyxml/tinyxml.h"
    40 #include "../../core/CoreIncludes.h"
    4140#include "core/BaseObject.h"
    4241#include "../Tickable.h"
     
    6766          int bulletsIndex_;
    6867  };
    69   ExportClass(BulletManager, Orxonox);
    7068}
    7169
Note: See TracChangeset for help on using the changeset viewer.