Index: branches/adm/src/world_entities/npcs/adm_turret.cc
===================================================================
--- branches/adm/src/world_entities/npcs/adm_turret.cc	(revision 10663)
+++ branches/adm/src/world_entities/npcs/adm_turret.cc	(revision 10663)
@@ -0,0 +1,156 @@
+/*
+* orxonox - the future of 3D-vertical-scrollers
+*
+* Copyright (C) 2004 orx
+*
+* 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, or (at your option)
+* any later version.
+*
+*     ### File Specific:
+*     main-programmer: Reto Luechinger
+*/
+
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+#include "adm_turret.h"
+#include "weapon_manager.h"
+#include "lib/util/loading/factory.h"
+#include "world_entities/projectiles/projectile.h"
+
+
+ObjectListDefinition(AdmTurret);
+CREATE_FACTORY(AdmTurret);
+
+public:
+       
+/**
+*  Standard constructor
+*/
+AdmTurret::AdmTurret ()
+{
+          this->init();
+}
+
+ 	
+/**
+*  destructs the turret, deletes allocated memory
+*/
+AdmTurret::~AdmTurret ()
+{
+          // will be deleted
+}
+
+AdmTurret::AdmTurret (const  TiXmlElemet* root)
+{
+             this->init();
+             if (root != NULL)
+                 this->loadParams(root);
+}
+        
+void AdmTurret::init()
+{
+     this->registerObject(this, GroundTurret::_objectList);
+     
+     // load the 3 parts of the turret
+     // this-> loadModel ("...", , )
+     // this-> loadModel ("...", , )
+     // this-> loadModel ("...", , )
+     
+     
+     //Cannon Node: 2 Cannons fixed left and right of the main turret
+     this->cannonNode.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT)
+     this->cannonNode.addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE)
+     this->cannonNode.setParent(this)
+     // this->cannonNode.setRelCoor( , , )
+     
+     
+     
+     //Sensor Node: Sensor rotating independently from main turret (like Radar)
+     this->sensorNode.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT)
+     this->sensorNode.addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE)
+     this->sensorNode.setParent(this)
+     // this->sensorNode.setRelCoor( , , )
+     
+
+     this->setStateDuration(WS_SHOOTING, .1);
+     this->setStateDuration(WS_RELOADING, .1);
+ 	 this->setStateDuration(WS_ACTIVATING, .4);
+ 	 this->setStateDuration(WS_DEACTIVATING, .4);
+
+ 	 this->setEnergyMax(10000);
+ 	 this->increaseEnergy(10000);
+ 	 //this->minCharge = ;
+ 	
+     //this->setActionSound(WA_SHOOT, "sounds/guns/xyz.wav");
+ 	 //this->setActionSound(WA_ACTIVATE, "sounds/voices/xxyz.wav");
+
+ 	 this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+ 	 this->setProjectileTypeC("Projectile");
+ 	 // this->prepareProjectiles(10000);
+ 	 
+      
+     // PROBLEM!! 2 emission Points! 
+     // this->setEmissionPoint(Vector( , , ) );
+     
+     // initialise here
+}
+
+void AdmTurret::loadParams(const TiXmlElement* root)
+{
+        Weapon::loadParams(root);
+        
+        LoadParam(root, "target", this, GroundTurret, setTarget)
+}
+
+virtual void AdmTurret::tick(float dt);
+
+virtual void GroundTurret::draw() const;
+
+virtual void AdmTurret::collidesWith(WorldEntity* entity, const Vector& location);
+
+virtual void AdmTurret::activate()
+{
+}
+        
+virtual void AdmTurret::deactivate()
+{        
+}
+
+virtual void AdmTurret::setTarget(const std::string& target)
+{
+        WorldEntity* targetEntity = WorldEntity::objectList().getObject(target);
+        if (targetEntity != NULL) 
+        {
+            this->myTarget = targetEntity;
+        }
+        else
+        {
+            PRINTF(2)("ERROR ADMTURRET : Target %s does not exist\n", target.c_str());
+        }
+}
+            
+private:
+        
+bool AdmTurret::isVisible(const WorldEntity myTarget)
+{     
+}
+
+float AdmTurret::aim(const WorldEntity Target);
+
+void AdmTurret::fire()
+{
+     Projectile* pj =  this->getProjectile();
+     if (pj == NULL) return;
+     
+     //pj->setOwner(this->getOwner());
+	 
+     //pj->setParent(PNode::getNullParent());
+
+ 	 //pj->setVelocity(this->getAbsDir().apply(Vector( , , )) );
+ 	 
+	 //pj->setAbsCoor(this->getEmissionPoint());
+	 //pj->setAbsDir(this->getAbsDir());
+	 //pj->activate();
+}	
Index: branches/adm/src/world_entities/npcs/adm_turret.h
===================================================================
--- branches/adm/src/world_entities/npcs/adm_turret.h	(revision 10663)
+++ branches/adm/src/world_entities/npcs/adm_turret.h	(revision 10663)
@@ -0,0 +1,42 @@
+/*
+* file groundTurret.h
+* A weapon that is fix located, and automatically shooting at a target.
+*/
+
+#ifndef _ADM_TURRET_H
+#define _ADM_TURRET_H
+
+//#include "sound_buffer.h"
+//#include "sound_source.h"
+
+#include "weapon.h"
+
+class GroundTurret : public WorldEntity
+      {
+                   ObjectListDeclaration(AdmTurret);
+      public:
+                   AdmTurret ();
+                   AdmTurret (const  TiXmlElement* root);
+                   virtual ~AdmTurret();
+                   
+                   void init();
+                   void loadParams(const TiXmlElement* root);
+                   
+                   virtual void tick(float dt);
+                   virtual void draw() const;
+                   virtual void collidesWith(WorldEntity* entity, const Vector& location);
+                   
+                   virtual void activate();
+                   virtual void deactivate();
+                   
+                   virtual void setTarget(const std::string& target);
+                   
+      private:
+                   PNode cannonNode;
+                   PNode sensorNode;
+                   WorldEntity* myTarget;
+                   bool isVisible(const WorldEntity myTarget);
+                   float aim(const WorldEntity Target);
+                   void fire();
+                                            
+      }
