Index: code/branches/shaders/src/orxonox/graphics/LensFlare.cc
===================================================================
--- code/branches/shaders/src/orxonox/graphics/LensFlare.cc	(revision 9466)
+++ code/branches/shaders/src/orxonox/graphics/LensFlare.cc	(revision 9491)
@@ -85,5 +85,4 @@
         this->occlusionBillboard_ = new Billboard(this);
         this->occlusionBillboard_->setMaterial("lensflare/hoq");
-        this->occlusionBillboard_->setPosition(this->getPosition());
         this->occlusionBillboard_->setVisible(false);
         this->occlusionBillboard_->disableFrustumCulling();
@@ -93,5 +92,4 @@
         Billboard* burst = new Billboard(this);
         burst->setMaterial("lensflare/burst");
-        burst->setPosition(this->getPosition());
         burst->disableFrustumCulling();
         burst->setVisible(true);
@@ -100,5 +98,4 @@
         Billboard* bursthalo = new Billboard(this);
         bursthalo->setMaterial("lensflare/bursthalo");
-        bursthalo->setPosition(this->getPosition());
         bursthalo->disableFrustumCulling();
         bursthalo->setVisible(true);
@@ -107,5 +104,4 @@
         bursthalo = new Billboard(this);
         bursthalo->setMaterial("lensflare/halo1");
-        bursthalo->setPosition(this->getPosition());
         bursthalo->disableFrustumCulling();
         bursthalo->setVisible(true);
@@ -114,5 +110,4 @@
         bursthalo = new Billboard(this);
         bursthalo->setMaterial("lensflare/halo2");
-        bursthalo->setPosition(this->getPosition());
         bursthalo->disableFrustumCulling();
         bursthalo->setVisible(true);
@@ -121,5 +116,4 @@
         bursthalo = new Billboard(this);
         bursthalo->setMaterial("lensflare/halo3");
-        bursthalo->setPosition(this->getPosition());
         bursthalo->disableFrustumCulling();
         bursthalo->setVisible(true);
@@ -143,10 +137,9 @@
         int i=0;
         float step=0.0f;
-        Vector3 position=CameraManager::getInstance().getActiveCamera()->getOgreCamera()->getDerivedPosition();
         for(std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++) {
             Billboard* billboard=static_cast<Billboard*>(*it);
-            billboard->setPosition(this->getPosition()-viewDirection*step);
+            billboard->setPosition(-viewDirection*step);
             billboard->setVisible(lightIsVisible);
-            billboard->setDefaultDimensions((i<0?0.5f:1.0f)*(i>2?0.25f:1.0f)*dimension*std::pow((1.0f-step),-1.0f),(i<0?0.5f:1.0f)*(i>2?0.25f:1.0f)*dimension*std::pow((1.0f-step),-1.0f));
+            billboard->setDefaultDimensions((i==0?0.5f:1.0f)*(i>2?0.25f:1.0f)*dimension*std::pow((1.0f-step),-1.0f),(i==0?0.5f:1.0f)*(i>2?0.25f:1.0f)*dimension*std::pow((1.0f-step),-1.0f));
             step=0.25f*(i>2?(i-2):0);
             i++;
@@ -168,5 +161,5 @@
             if(i==2)
             {
-                this->colour_->a*=0.5f;
+                this->colour_->a*=0.33f;
             }
             Billboard* billboard=static_cast<Billboard*>(*it);
@@ -187,5 +180,5 @@
     {
         Ogre::Camera* camera=CameraManager::getInstance().getActiveCamera()->getOgreCamera();
-        Vector3 position = this->getPosition();
+        Vector3 position = this->getWorldPosition();
         Vector3 nX = camera->getDerivedOrientation().xAxis().normalisedCopy();
         Vector3 nY = camera->getDerivedOrientation().yAxis().normalisedCopy();
@@ -212,5 +205,5 @@
         {
             Ogre::Camera* camera=CameraManager::getInstance().getActiveCamera()->getOgreCamera(); //get active Ogre Camera Instance, so we can check whether the light source is visible
-            this->cameraDistance_=camera->getPosition().distance(this->getPosition());
+            this->cameraDistance_=camera->getDerivedPosition().distance(this->getPosition());
             float dimension=this->cameraDistance_*this->scale_;
             if(!this->fadeOnViewBorder_)
@@ -218,9 +211,9 @@
                 this->fadeResolution_=3;//this is so we can still determine when the billboard has left the screen
             }
-            unsigned int pointCount=this->getPointCount(dimension*0.5f);
-            Vector3 viewDirection=this->getPosition()-camera->getDerivedPosition()-camera->getDerivedDirection()*this->cameraDistance_;
+            unsigned int pointCount=this->getPointCount(dimension*0.25f*this->scale_);
+            Vector3 viewDirection=this->getWorldPosition()-camera->getDerivedPosition()-camera->getDerivedDirection()*this->cameraDistance_;
             updateBillboardStates(viewDirection,dimension,pointCount>0);
             if(pointCount>0) {
-                Ogre::Sphere* sphere=new Ogre::Sphere(this->getPosition(),dimension*0.25f);
+                Ogre::Sphere* sphere=new Ogre::Sphere(this->getPosition(),dimension*0.25f*this->scale_);
                 float left, right, top, bottom;
                 camera->projectSphere(*sphere,&left,&top,&right,&bottom);//approximate maximum pixel count of billboard with a sphere
