Index: code/branches/network/src/orxonox/objects/Ambient.cc
===================================================================
--- code/branches/network/src/orxonox/objects/Ambient.cc	(revision 1486)
+++ code/branches/network/src/orxonox/objects/Ambient.cc	(revision 1494)
Index: code/branches/network/src/orxonox/objects/Ambient.h
===================================================================
--- code/branches/network/src/orxonox/objects/Ambient.h	(revision 1486)
+++ code/branches/network/src/orxonox/objects/Ambient.h	(revision 1494)
Index: code/branches/network/src/orxonox/objects/Camera.cc
===================================================================
--- code/branches/network/src/orxonox/objects/Camera.cc	(revision 1486)
+++ code/branches/network/src/orxonox/objects/Camera.cc	(revision 1494)
Index: code/branches/network/src/orxonox/objects/Camera.h
===================================================================
--- code/branches/network/src/orxonox/objects/Camera.h	(revision 1486)
+++ code/branches/network/src/orxonox/objects/Camera.h	(revision 1494)
@@ -1,71 +1,3 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      Benjamin Knecht
- *
- */
-
-#ifndef _Camera_H__
-#define _Camera_H__
-
-#include <OgrePrerequisites.h>
-#include <OgreSceneNode.h>
-#include <OgreCamera.h>
-
-#include "OrxonoxPrereqs.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport Camera
-    {
-      friend class CameraHandler;
-      public:
-        Camera(Ogre::SceneNode* node = NULL);
-        virtual ~Camera();
-
-        void setPositionNode(Ogre::SceneNode* node);
-        inline Ogre::SceneNode* getCameraNode() { return this->positionNode_; }
-        // maybe also BaseObject
-        void setTargetNode(Ogre::SceneNode* obj);
-
+/* *   ORXONOX - the hottest 3D action shooter ever to exist *                    > www.orxonox.net < * * *   License notice: * *   This program is free software; you can redistribute it and/or *   modify it under the terms of the GNU General Public License *   as published by the Free Software Foundation; either version 2 *   of the License, or (at your option) any later version. * *   This program is distributed in the hope that it will be useful, *   but WITHOUT ANY WARRANTY; without even the implied warranty of *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *   GNU General Public License for more details. * *   You should have received a copy of the GNU General Public License *   along with this program; if not, write to the Free Software *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. * *   Author: *      Fabian 'x3n' Landau *   Co-authors: *      Benjamin Knecht * */#ifndef _Camera_H__#define _Camera_H__#include <OgrePrerequisites.h>#include <OgreSceneNode.h>#include <OgreCamera.h>#include "OrxonoxPrereqs.h"namespace orxonox{    class _OrxonoxExport Camera    {      friend class CameraHandler;      public:        Camera(Ogre::SceneNode* node = NULL);        virtual ~Camera();        void setPositionNode(Ogre::SceneNode* node);        inline Ogre::SceneNode* getCameraNode() { return this->positionNode_; }        // maybe also BaseObject        void setTargetNode(Ogre::SceneNode* obj);
         Ogre::Camera* cam_;
-
-        void tick(float dt);
-        void update();
-        inline bool hasFocus() { return this->bHasFocus_; }
-
-      private:
-        void removeFocus();
-        void setFocus(Ogre::Camera* ogreCam);
-
-      private:
-        Ogre::SceneNode* targetNode_;
-        Ogre::SceneNode* positionNode_;
-        Ogre::SceneNode* cameraNode_;
-        Ogre::Vector3 oldPos;
-        bool bHasFocus_;
-    };
-}
-
-#endif /* _Camera_H__ */
+        void tick(float dt);        void update();        inline bool hasFocus() { return this->bHasFocus_; }      private:        void removeFocus();        void setFocus(Ogre::Camera* ogreCam);      private:        Ogre::SceneNode* targetNode_;        Ogre::SceneNode* positionNode_;        Ogre::SceneNode* cameraNode_;        Ogre::Vector3 oldPos;        bool bHasFocus_;    };}#endif /* _Camera_H__ */
Index: code/branches/network/src/orxonox/objects/Explosion.cc
===================================================================
--- code/branches/network/src/orxonox/objects/Explosion.cc	(revision 1486)
+++ code/branches/network/src/orxonox/objects/Explosion.cc	(revision 1494)
Index: code/branches/network/src/orxonox/objects/Explosion.h
===================================================================
--- code/branches/network/src/orxonox/objects/Explosion.h	(revision 1486)
+++ code/branches/network/src/orxonox/objects/Explosion.h	(revision 1494)
Index: code/branches/network/src/orxonox/objects/Model.h
===================================================================
--- code/branches/network/src/orxonox/objects/Model.h	(revision 1486)
+++ code/branches/network/src/orxonox/objects/Model.h	(revision 1494)
Index: code/branches/network/src/orxonox/objects/NPC.h
===================================================================
--- code/branches/network/src/orxonox/objects/NPC.h	(revision 1486)
+++ code/branches/network/src/orxonox/objects/NPC.h	(revision 1494)
Index: code/branches/network/src/orxonox/objects/Projectile.cc
===================================================================
--- code/branches/network/src/orxonox/objects/Projectile.cc	(revision 1486)
+++ code/branches/network/src/orxonox/objects/Projectile.cc	(revision 1494)
Index: code/branches/network/src/orxonox/objects/Projectile.h
===================================================================
--- code/branches/network/src/orxonox/objects/Projectile.h	(revision 1486)
+++ code/branches/network/src/orxonox/objects/Projectile.h	(revision 1494)
Index: code/branches/network/src/orxonox/objects/RotatingProjectile.cc
===================================================================
--- code/branches/network/src/orxonox/objects/RotatingProjectile.cc	(revision 1486)
+++ code/branches/network/src/orxonox/objects/RotatingProjectile.cc	(revision 1494)
Index: code/branches/network/src/orxonox/objects/RotatingProjectile.h
===================================================================
--- code/branches/network/src/orxonox/objects/RotatingProjectile.h	(revision 1486)
+++ code/branches/network/src/orxonox/objects/RotatingProjectile.h	(revision 1494)
Index: code/branches/network/src/orxonox/objects/Skybox.cc
===================================================================
--- code/branches/network/src/orxonox/objects/Skybox.cc	(revision 1486)
+++ code/branches/network/src/orxonox/objects/Skybox.cc	(revision 1494)
Index: code/branches/network/src/orxonox/objects/Skybox.h
===================================================================
--- code/branches/network/src/orxonox/objects/Skybox.h	(revision 1486)
+++ code/branches/network/src/orxonox/objects/Skybox.h	(revision 1494)
Index: code/branches/network/src/orxonox/objects/SpaceShip.cc
===================================================================
--- code/branches/network/src/orxonox/objects/SpaceShip.cc	(revision 1486)
+++ code/branches/network/src/orxonox/objects/SpaceShip.cc	(revision 1494)
Index: code/branches/network/src/orxonox/objects/SpaceShip.h
===================================================================
--- code/branches/network/src/orxonox/objects/SpaceShip.h	(revision 1486)
+++ code/branches/network/src/orxonox/objects/SpaceShip.h	(revision 1494)
Index: code/branches/network/src/orxonox/objects/SpaceShipAI.cc
===================================================================
--- code/branches/network/src/orxonox/objects/SpaceShipAI.cc	(revision 1486)
+++ code/branches/network/src/orxonox/objects/SpaceShipAI.cc	(revision 1494)
@@ -1,293 +1,2 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "SpaceShipAI.h"
-
-#include <OgreMath.h>
-#include "Projectile.h"
-#include "core/CoreIncludes.h"
-#include "core/Iterator.h"
-#include "core/Executor.h"
-#include "core/ConsoleCommand.h"
-#include "core/XMLPort.h"
-
-#define ACTION_INTERVAL 1.0f
-
-namespace orxonox
-{
-    SetConsoleCommand(SpaceShipAI, createEnemy, true).setDefaultValue(0, 1);
-    SetConsoleCommand(SpaceShipAI, killEnemies, true).setDefaultValue(0, 0);
-
-    CreateFactory(SpaceShipAI);
-
-    SpaceShipAI::SpaceShipAI()
-    {
-        RegisterObject(SpaceShipAI);
-
-        this->alive_ = true;
-        this->setPosition(Vector3(rnd(-1000, 1000), rnd(-1000, 1000), rnd(-1000, 0000)));
-        this->target_ = 0;
-        this->bShooting_ = 0;
-        this->bHasTargetPosition_ = false;
-
-        this->setTeamNr((int)rnd(NUM_AI_TEAMS) % NUM_AI_TEAMS + 1);
-
-        if (NUM_AI_TEAMS > 0)
-            this->teamColours_[1] = ColourValue(1, 0, 0, 1);
-        if (NUM_AI_TEAMS > 1)
-            this->teamColours_[2] = ColourValue(0, 1, 0, 1);
-        if (NUM_AI_TEAMS > 2)
-            this->teamColours_[3] = ColourValue(0, 0, 1, 1);
-
-        for (int i = 4; i <= NUM_AI_TEAMS; ++i)
-            this->teamColours_[i] = ColourValue(rnd(), rnd(), rnd(), 1);
-    }
-
-    void SpaceShipAI::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SpaceShip::XMLPort(xmlelement, mode);
-        myShip_=true;
-
-        this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&SpaceShipAI::action)));
-    }
-
-    void SpaceShipAI::createEnemy(int num)
-    {
-        for (int i = 0; i < num; ++i)
-        {
-            SpaceShipAI* newenemy = new SpaceShipAI();
-            newenemy->setMesh("assff.mesh");
-//            newenemy->setPosition(0, 0, 0);
-            newenemy->setScale(10);
-            newenemy->setMaxSpeed(500);
-            newenemy->setMaxSideAndBackSpeed(50);
-            newenemy->setMaxRotation(1.0);
-            newenemy->setTransAcc(200);
-            newenemy->setRotAcc(3.0);
-            newenemy->setTransDamp(75);
-            newenemy->setRotDamp(1.0);
-            Element xmlelement;
-            newenemy->XMLPort(xmlelement, XMLPort::LoadObject);
-        }
-    }
-
-    void SpaceShipAI::killEnemies(int num)
-    {
-        int i = 0;
-        for (Iterator<SpaceShipAI> it = ObjectList<SpaceShipAI>::begin(); it; )
-        {
-            delete *(it++);
-            ++i;
-            if (num && i >= num)
-                break;
-        }
-    }
-
-    ColourValue SpaceShipAI::getProjectileColour() const
-    {
-        return this->teamColours_[this->getTeamNr()];
-    }
-
-    void SpaceShipAI::action()
-    {
-        float random;
-        float maxrand = 100.0f / ACTION_INTERVAL;
-
-        // search enemy
-        random = rnd(maxrand);
-//std::cout << "search enemy: " << random << std::endl;
-        if (random < 20 && (!this->target_))
-        {
-            this->searchNewTarget();
-        }
-
-        // forget enemy
-        random = rnd(maxrand);
-//std::cout << "forget enemy: " << random << std::endl;
-        if (random < 5 && (this->target_))
-        {
-            this->forgetTarget();
-        }
-
-        // next enemy
-        random = rnd(maxrand);
-//std::cout << "next enemy: " << random << std::endl;
-        if (random < 10 && (this->target_))
-        {
-            this->searchNewTarget();
-        }
-
-        // fly somewhere
-        random = rnd(maxrand);
-//std::cout << "fly somewhere: " << random << std::endl;
-        if (random < 40 && (!this->bHasTargetPosition_ && !this->target_))
-        {
-            this->searchNewTargetPosition();
-        }
-
-        // stop flying
-        random = rnd(maxrand);
-//std::cout << "stop flying: " << random << std::endl;
-        if (random < 10 && (this->bHasTargetPosition_ && !this->target_))
-        {
-            this->bHasTargetPosition_ = false;
-        }
-
-        // fly somewhere else
-        random = rnd(maxrand);
-//std::cout << "fly somewhere else: " << random << std::endl;
-        if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
-        {
-            this->searchNewTargetPosition();
-        }
-
-        // shoot
-        random = rnd(maxrand);
-//std::cout << "shoot: " << random << std::endl;
-        if (random < 75 && (this->target_ && !this->bShooting_))
-        {
-            this->bShooting_ = true;
-        }
-
-        // stop shooting
-        random = rnd(maxrand);
-//std::cout << "stop shooting: " << random << std::endl;
-        if (random < 25 && (this->bShooting_))
-        {
-            this->bShooting_ = false;
-        }
-    }
-
-    void SpaceShipAI::tick(float dt)
-    {
-        if (this->target_)
-            this->aimAtTarget();
-
-        if (this->bHasTargetPosition_)
-            this->moveToTargetPosition(dt);
-
-        if (this->bShooting_ && this->isCloseAtTarget(2000) && this->isLookingAtTarget(Ogre::Math::PI / 10.0f))
-            this->doFire();
-
-        SpaceShip::tick(dt);
-    }
-
-    void SpaceShipAI::moveToTargetPosition(float dt)
-    {
-        static Radian RadianZERO(0);
-
-//        float dotprod = (this->getOrientation() * Ogre::Vector3::UNIT_X).dotProduct(this->targetPosition_ - this->getPosition());
-        Quaternion rotation = (this->getOrientation() * Ogre::Vector3::UNIT_X).getRotationTo(this->targetPosition_ - this->getPosition());
-/*
-std::cout << "scalprod: " << dotprod << std::endl;
-std::cout << "dist: " << this->targetPosition_ - this->getPosition() << std::endl;
-std::cout << "yaw: " << rotation.getYaw().valueRadians() << std::endl;
-std::cout << "pitch: " << rotation.getPitch().valueRadians() << std::endl;
-std::cout << "roll: " << rotation.getRoll().valueRadians() << std::endl;
-*/
-        this->setMoveYaw(-rotation.getRoll().valueRadians());
-        this->setMovePitch(rotation.getYaw().valueRadians());
-
-        if ((this->targetPosition_ - this->getPosition()).length() > 100)
-        {
-            this->setMoveLongitudinal(1);
-        }
-
-    }
-
-    void SpaceShipAI::searchNewTargetPosition()
-    {
-        this->targetPosition_ = Vector3(rnd(-5000,5000), rnd(-5000,5000), rnd(-5000,5000));
-        this->bHasTargetPosition_ = true;
-    }
-
-    void SpaceShipAI::searchNewTarget()
-    {
-        this->targetPosition_ = this->getPosition();
-        this->forgetTarget();
-
-        for (Iterator<SpaceShip> it = ObjectList<SpaceShip>::begin(); it; ++it)
-        {
-            if (it->getTeamNr() != this->getTeamNr())
-            {
-                float speed = this->getVelocity().length();
-                Vector3 distanceCurrent = this->targetPosition_ - this->getPosition();
-                Vector3 distanceNew = it->getPosition() - this->getPosition();
-                if (!this->target_ || it->getPosition().squaredDistance(this->getPosition()) * (1.5f + acos((this->getOrientation() * Ogre::Vector3::UNIT_X).dotProduct(distanceNew) / speed / distanceNew.length()) / (2 * Ogre::Math::PI))
-                        < this->targetPosition_.squaredDistance(this->getPosition()) * (1.5f + acos((this->getOrientation() * Ogre::Vector3::UNIT_X).dotProduct(distanceCurrent) / speed / distanceCurrent.length()) / (2 * Ogre::Math::PI)))
-                {
-                    this->target_ = (*it);
-                    this->targetPosition_ = it->getPosition();
-                }
-            }
-        }
-   }
-
-    void SpaceShipAI::forgetTarget()
-    {
-        this->target_ = 0;
-        this->bShooting_ = false;
-    }
-
-    void SpaceShipAI::aimAtTarget()
-    {
-        if (!this->target_)
-            return;
-/*
-        Vector3 enemymovement = this->target_->getVelocity();
-        Vector3 distance_normalised = this->target_->getPosition() - this->getPosition();
-        distance_normalised.normalise();
-
-        float scalarprod = enemymovement.dotProduct(distance_normalised);
-        float aimoffset = scalarprod*scalarprod + Projectile::getSpeed() * Projectile::getSpeed() - this->target_->getVelocity().squaredLength();
-        if (aimoffset < 0)
-        {
-            this->bHasTargetPosition_ = false;
-            return;
-        }
-        aimoffset = -scalarprod + sqrt(aimoffset);
-        this->targetPosition_ = enemymovement + distance_normalised * aimoffset;
-        this->bHasTargetPosition_ = true;
-
-        std::cout << "targetpos: " << this->targetPosition_ << std::endl;
-*/
-        this->targetPosition_ = this->target_->getPosition();
-        this->bHasTargetPosition_ = true;
-    }
-
-    bool SpaceShipAI::isCloseAtTarget(float distance)
-    {
-        return (this->getPosition().squaredDistance(this->targetPosition_) < distance*distance);
-    }
-
-    bool SpaceShipAI::isLookingAtTarget(float angle)
-    {
-        return (this->getOrientation() * Ogre::Vector3::UNIT_X).directionEquals(this->targetPosition_ - this->getPosition(), Radian(angle));
-    }
-}
+/* *   ORXONOX - the hottest 3D action shooter ever to exist *                    > www.orxonox.net < * * *   License notice: * *   This program is free software; you can redistribute it and/or *   modify it under the terms of the GNU General Public License *   as published by the Free Software Foundation; either version 2 *   of the License, or (at your option) any later version. * *   This program is distributed in the hope that it will be useful, *   but WITHOUT ANY WARRANTY; without even the implied warranty of *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *   GNU General Public License for more details. * *   You should have received a copy of the GNU General Public License *   along with this program; if not, write to the Free Software *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. * *   Author: *      Fabian 'x3n' Landau *   Co-authors: *      ... * */#include "OrxonoxStableHeaders.h"
+#include "SpaceShipAI.h"#include <OgreMath.h>#include "Projectile.h"#include "core/CoreIncludes.h"#include "core/Iterator.h"#include "core/Executor.h"#include "core/ConsoleCommand.h"#include "core/XMLPort.h"#define ACTION_INTERVAL 1.0fnamespace orxonox{    SetConsoleCommand(SpaceShipAI, createEnemy, true).setDefaultValue(0, 1);    SetConsoleCommand(SpaceShipAI, killEnemies, true).setDefaultValue(0, 0);    CreateFactory(SpaceShipAI);    SpaceShipAI::SpaceShipAI()    {        RegisterObject(SpaceShipAI);        this->alive_ = true;        this->setPosition(Vector3(rnd(-1000, 1000), rnd(-1000, 1000), rnd(-1000, 0000)));        this->target_ = 0;        this->bShooting_ = 0;        this->bHasTargetPosition_ = false;        this->setTeamNr((int)rnd(NUM_AI_TEAMS) % NUM_AI_TEAMS + 1);        if (NUM_AI_TEAMS > 0)            this->teamColours_[1] = ColourValue(1, 0, 0, 1);        if (NUM_AI_TEAMS > 1)            this->teamColours_[2] = ColourValue(0, 1, 0, 1);        if (NUM_AI_TEAMS > 2)            this->teamColours_[3] = ColourValue(0, 0, 1, 1);        for (int i = 4; i <= NUM_AI_TEAMS; ++i)            this->teamColours_[i] = ColourValue(rnd(), rnd(), rnd(), 1);    }    void SpaceShipAI::XMLPort(Element& xmlelement, XMLPort::Mode mode)    {        SpaceShip::XMLPort(xmlelement, mode);        myShip_=true;        this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&SpaceShipAI::action)));    }    void SpaceShipAI::createEnemy(int num)    {        for (int i = 0; i < num; ++i)        {            SpaceShipAI* newenemy = new SpaceShipAI();            newenemy->setMesh("assff.mesh");//            newenemy->setPosition(0, 0, 0);            newenemy->setScale(10);            newenemy->setMaxSpeed(500);            newenemy->setMaxSideAndBackSpeed(50);            newenemy->setMaxRotation(1.0);            newenemy->setTransAcc(200);            newenemy->setRotAcc(3.0);            newenemy->setTransDamp(75);            newenemy->setRotDamp(1.0);            Element xmlelement;            newenemy->XMLPort(xmlelement, XMLPort::LoadObject);        }    }    void SpaceShipAI::killEnemies(int num)    {        int i = 0;        for (Iterator<SpaceShipAI> it = ObjectList<SpaceShipAI>::begin(); it; )        {            delete *(it++);            ++i;            if (num && i >= num)                break;        }    }    ColourValue SpaceShipAI::getProjectileColour() const    {        return this->teamColours_[this->getTeamNr()];    }    void SpaceShipAI::action()    {        float random;        float maxrand = 100.0f / ACTION_INTERVAL;        // search enemy        random = rnd(maxrand);//std::cout << "search enemy: " << random << std::endl;        if (random < 20 && (!this->target_))        {            this->searchNewTarget();        }        // forget enemy        random = rnd(maxrand);//std::cout << "forget enemy: " << random << std::endl;        if (random < 5 && (this->target_))        {            this->forgetTarget();        }        // next enemy        random = rnd(maxrand);//std::cout << "next enemy: " << random << std::endl;        if (random < 10 && (this->target_))        {            this->searchNewTarget();        }        // fly somewhere        random = rnd(maxrand);//std::cout << "fly somewhere: " << random << std::endl;        if (random < 40 && (!this->bHasTargetPosition_ && !this->target_))        {            this->searchNewTargetPosition();        }        // stop flying        random = rnd(maxrand);//std::cout << "stop flying: " << random << std::endl;        if (random < 10 && (this->bHasTargetPosition_ && !this->target_))        {            this->bHasTargetPosition_ = false;        }        // fly somewhere else        random = rnd(maxrand);//std::cout << "fly somewhere else: " << random << std::endl;        if (random < 30 && (this->bHasTargetPosition_ && !this->target_))        {            this->searchNewTargetPosition();        }        // shoot        random = rnd(maxrand);//std::cout << "shoot: " << random << std::endl;        if (random < 75 && (this->target_ && !this->bShooting_))        {            this->bShooting_ = true;        }        // stop shooting        random = rnd(maxrand);//std::cout << "stop shooting: " << random << std::endl;        if (random < 25 && (this->bShooting_))        {            this->bShooting_ = false;        }    }    void SpaceShipAI::tick(float dt)    {        if (this->target_)            this->aimAtTarget();        if (this->bHasTargetPosition_)            this->moveToTargetPosition(dt);        if (this->bShooting_ && this->isCloseAtTarget(2000) && this->isLookingAtTarget(Ogre::Math::PI / 10.0f))            this->doFire();        SpaceShip::tick(dt);    }    void SpaceShipAI::moveToTargetPosition(float dt)    {        static Radian RadianZERO(0);//        float dotprod = (this->getOrientation() * Ogre::Vector3::UNIT_X).dotProduct(this->targetPosition_ - this->getPosition());        Quaternion rotation = (this->getOrientation() * Ogre::Vector3::UNIT_X).getRotationTo(this->targetPosition_ - this->getPosition());/*std::cout << "scalprod: " << dotprod << std::endl;std::cout << "dist: " << this->targetPosition_ - this->getPosition() << std::endl;std::cout << "yaw: " << rotation.getYaw().valueRadians() << std::endl;std::cout << "pitch: " << rotation.getPitch().valueRadians() << std::endl;std::cout << "roll: " << rotation.getRoll().valueRadians() << std::endl;*/        this->setMoveYaw(-rotation.getRoll().valueRadians());        this->setMovePitch(rotation.getYaw().valueRadians());        if ((this->targetPosition_ - this->getPosition()).length() > 100)        {            this->setMoveLongitudinal(1);        }    }    void SpaceShipAI::searchNewTargetPosition()    {        this->targetPosition_ = Vector3(rnd(-5000,5000), rnd(-5000,5000), rnd(-5000,5000));        this->bHasTargetPosition_ = true;    }    void SpaceShipAI::searchNewTarget()    {        this->targetPosition_ = this->getPosition();        this->forgetTarget();        for (Iterator<SpaceShip> it = ObjectList<SpaceShip>::begin(); it; ++it)        {            if (it->getTeamNr() != this->getTeamNr())            {                float speed = this->getVelocity().length();                Vector3 distanceCurrent = this->targetPosition_ - this->getPosition();                Vector3 distanceNew = it->getPosition() - this->getPosition();                if (!this->target_ || it->getPosition().squaredDistance(this->getPosition()) * (1.5f + acos((this->getOrientation() * Ogre::Vector3::UNIT_X).dotProduct(distanceNew) / speed / distanceNew.length()) / (2 * Ogre::Math::PI))                        < this->targetPosition_.squaredDistance(this->getPosition()) * (1.5f + acos((this->getOrientation() * Ogre::Vector3::UNIT_X).dotProduct(distanceCurrent) / speed / distanceCurrent.length()) / (2 * Ogre::Math::PI)))                {                    this->target_ = (*it);                    this->targetPosition_ = it->getPosition();                }            }        }   }    void SpaceShipAI::forgetTarget()    {        this->target_ = 0;        this->bShooting_ = false;    }    void SpaceShipAI::aimAtTarget()    {        if (!this->target_)            return;/*        Vector3 enemymovement = this->target_->getVelocity();        Vector3 distance_normalised = this->target_->getPosition() - this->getPosition();        distance_normalised.normalise();        float scalarprod = enemymovement.dotProduct(distance_normalised);        float aimoffset = scalarprod*scalarprod + Projectile::getSpeed() * Projectile::getSpeed() - this->target_->getVelocity().squaredLength();        if (aimoffset < 0)        {            this->bHasTargetPosition_ = false;            return;        }        aimoffset = -scalarprod + sqrt(aimoffset);        this->targetPosition_ = enemymovement + distance_normalised * aimoffset;        this->bHasTargetPosition_ = true;        std::cout << "targetpos: " << this->targetPosition_ << std::endl;*/        this->targetPosition_ = this->target_->getPosition();        this->bHasTargetPosition_ = true;    }    bool SpaceShipAI::isCloseAtTarget(float distance)    {        return (this->getPosition().squaredDistance(this->targetPosition_) < distance*distance);    }    bool SpaceShipAI::isLookingAtTarget(float angle)    {        return (this->getOrientation() * Ogre::Vector3::UNIT_X).directionEquals(this->targetPosition_ - this->getPosition(), Radian(angle));    }}
Index: code/branches/network/src/orxonox/objects/SpaceShipAI.h
===================================================================
--- code/branches/network/src/orxonox/objects/SpaceShipAI.h	(revision 1486)
+++ code/branches/network/src/orxonox/objects/SpaceShipAI.h	(revision 1494)
Index: code/branches/network/src/orxonox/objects/WorldEntity.cc
===================================================================
--- code/branches/network/src/orxonox/objects/WorldEntity.cc	(revision 1486)
+++ code/branches/network/src/orxonox/objects/WorldEntity.cc	(revision 1494)
Index: code/branches/network/src/orxonox/objects/WorldEntity.h
===================================================================
--- code/branches/network/src/orxonox/objects/WorldEntity.h	(revision 1486)
+++ code/branches/network/src/orxonox/objects/WorldEntity.h	(revision 1494)
Index: code/branches/network/src/orxonox/objects/weapon/AmmunitionDump.cc
===================================================================
--- code/branches/network/src/orxonox/objects/weapon/AmmunitionDump.cc	(revision 1486)
+++ code/branches/network/src/orxonox/objects/weapon/AmmunitionDump.cc	(revision 1494)
Index: code/branches/network/src/orxonox/objects/weapon/AmmunitionDump.h
===================================================================
--- code/branches/network/src/orxonox/objects/weapon/AmmunitionDump.h	(revision 1486)
+++ code/branches/network/src/orxonox/objects/weapon/AmmunitionDump.h	(revision 1494)
Index: code/branches/network/src/orxonox/objects/weapon/BarrelGun.cc
===================================================================
--- code/branches/network/src/orxonox/objects/weapon/BarrelGun.cc	(revision 1486)
+++ code/branches/network/src/orxonox/objects/weapon/BarrelGun.cc	(revision 1494)
Index: code/branches/network/src/orxonox/objects/weapon/BarrelGun.h
===================================================================
--- code/branches/network/src/orxonox/objects/weapon/BarrelGun.h	(revision 1486)
+++ code/branches/network/src/orxonox/objects/weapon/BarrelGun.h	(revision 1494)
Index: code/branches/network/src/orxonox/objects/weapon/BaseWeapon.cc
===================================================================
--- code/branches/network/src/orxonox/objects/weapon/BaseWeapon.cc	(revision 1486)
+++ code/branches/network/src/orxonox/objects/weapon/BaseWeapon.cc	(revision 1494)
Index: code/branches/network/src/orxonox/objects/weapon/BaseWeapon.h
===================================================================
--- code/branches/network/src/orxonox/objects/weapon/BaseWeapon.h	(revision 1486)
+++ code/branches/network/src/orxonox/objects/weapon/BaseWeapon.h	(revision 1494)
@@ -1,6 +1,5 @@
 /*
  *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
+ *                    > www.orxonox.net < *
  *
  *   License notice:
@@ -26,102 +25,3 @@
  *
  */
-
-
-#ifndef _BaseWeapon_H__
-#define _BaseWeapon_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include <OgrePrerequisites.h>
-
-#include "../Model.h"
-
-
-namespace orxonox {
-  class _OrxonoxExport BaseWeapon : public Model
-  {
-  public:
-    enum Action {
-      NOTHING  = 0,
-      RELOAD   = 1,
-      CHANGE_AMMO  = 2,
-      SPECIAL  = 3
-    };
-
-  protected:
-    enum State {
-      IDLE = 0,
-      PRIMARY_FIRE = 1,
-      SECONDARY_FIRE = 2,
-      RELOADING = 3,
-      CHANGING_AMMO = 4,
-    };
-
-  public:
-    BaseWeapon();
-	  virtual ~BaseWeapon();
-
-    bool addAction(const Action);
-
-    void primaryFireRequest();
-
-    void secondaryFireRequest();
-
-    int getAmmoState();
-
-    void setAmmoDump(AmmunitionDump*);
-
-    inline virtual void loadParams(TiXmlElement* xmlElem) { Model::loadParams(xmlElem); };
-
-    virtual void tick(float dt);
-
-  protected:
-    virtual void primaryFire() = 0;
-
-    virtual void primaryFiring(float) = 0;
-
-    virtual void secondaryFire() = 0;
-
-    virtual void secondaryFiring(float) = 0;
-
-    virtual void registerAllVariables() { };
-
-  public:
-
-  protected:
-    Ogre::SceneManager *sceneMgr_;
-
-    int bulletCounter_;
-    BulletManager *bulletManager_;
-
-    AmmunitionDump *ammoDump_;
-
-    bool primaryFireRequest_;
-    bool secondaryFireRequest_;
-
-    float totalTime_;
-    float actionStartTime_;
-
-    State currentState_;
-    bool secondaryFired_;
-
-    Action nextAction_;
-    bool actionAdded_;
-    float timeSinceNextActionAdded_;
-    static float nextActionValidityPeriod_s;
-
-    // weapon properties
-    int leftAmmo_;
-    float primaryFirePower_;
-    float secondaryFirePower_;
-    float primaryFiringRate_;
-    float secondaryFiringRate_;
-    Real primaryBulletSpeed_;
-    Real secondaryBulletSpeed_;
-
-    int magazineSize_;
-
-  };
-}
-
-#endif /* _BaseWeapon_H__ */
+#ifndef _BaseWeapon_H__#define _BaseWeapon_H__#include "OrxonoxPrereqs.h"#include <OgrePrerequisites.h>#include "../Model.h"namespace orxonox {  class _OrxonoxExport BaseWeapon : public Model  {  public:    enum Action {      NOTHING  = 0,      RELOAD   = 1,      CHANGE_AMMO  = 2,      SPECIAL  = 3    };  protected:    enum State {      IDLE = 0,      PRIMARY_FIRE = 1,      SECONDARY_FIRE = 2,      RELOADING = 3,      CHANGING_AMMO = 4,    };  public:    BaseWeapon();	  virtual ~BaseWeapon();    bool addAction(const Action);    void primaryFireRequest();    void secondaryFireRequest();    int getAmmoState();    void setAmmoDump(AmmunitionDump*);    inline virtual void loadParams(TiXmlElement* xmlElem) { Model::loadParams(xmlElem); };    virtual void tick(float dt);  protected:    virtual void primaryFire() = 0;    virtual void primaryFiring(float) = 0;    virtual void secondaryFire() = 0;    virtual void secondaryFiring(float) = 0;    virtual void registerAllVariables() { };  public:  protected:    Ogre::SceneManager *sceneMgr_;    int bulletCounter_;    BulletManager *bulletManager_;    AmmunitionDump *ammoDump_;    bool primaryFireRequest_;    bool secondaryFireRequest_;    float totalTime_;    float actionStartTime_;    State currentState_;    bool secondaryFired_;    Action nextAction_;    bool actionAdded_;    float timeSinceNextActionAdded_;    static float nextActionValidityPeriod_s;    // weapon properties    int leftAmmo_;    float primaryFirePower_;    float secondaryFirePower_;    float primaryFiringRate_;    float secondaryFiringRate_;    Real primaryBulletSpeed_;    Real secondaryBulletSpeed_;    int magazineSize_;  };}#endif /* _BaseWeapon_H__ */
Index: code/branches/network/src/orxonox/objects/weapon/Bullet.cc
===================================================================
--- code/branches/network/src/orxonox/objects/weapon/Bullet.cc	(revision 1486)
+++ code/branches/network/src/orxonox/objects/weapon/Bullet.cc	(revision 1494)
Index: code/branches/network/src/orxonox/objects/weapon/Bullet.h
===================================================================
--- code/branches/network/src/orxonox/objects/weapon/Bullet.h	(revision 1486)
+++ code/branches/network/src/orxonox/objects/weapon/Bullet.h	(revision 1494)
Index: code/branches/network/src/orxonox/objects/weapon/BulletManager.cc
===================================================================
--- code/branches/network/src/orxonox/objects/weapon/BulletManager.cc	(revision 1486)
+++ code/branches/network/src/orxonox/objects/weapon/BulletManager.cc	(revision 1494)
Index: code/branches/network/src/orxonox/objects/weapon/BulletManager.h
===================================================================
--- code/branches/network/src/orxonox/objects/weapon/BulletManager.h	(revision 1486)
+++ code/branches/network/src/orxonox/objects/weapon/BulletManager.h	(revision 1494)
Index: code/branches/network/src/orxonox/objects/weapon/WeaponStation.cc
===================================================================
--- code/branches/network/src/orxonox/objects/weapon/WeaponStation.cc	(revision 1486)
+++ code/branches/network/src/orxonox/objects/weapon/WeaponStation.cc	(revision 1494)
Index: code/branches/network/src/orxonox/objects/weapon/WeaponStation.h
===================================================================
--- code/branches/network/src/orxonox/objects/weapon/WeaponStation.h	(revision 1486)
+++ code/branches/network/src/orxonox/objects/weapon/WeaponStation.h	(revision 1494)
