Changeset 9180 in orxonox.OLD for branches/presentation/src/world_entities/npcs/space_turret.cc
- Timestamp:
- Jul 5, 2006, 12:49:40 AM (18 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/world_entities/npcs/space_turret.cc
r9178 r9180 14 14 */ 15 15 16 #include " ground_turret.h"16 #include "space_turret.h" 17 17 #include "model.h" 18 18 #include "world_entities/weapons/turret.h" … … 29 29 #include "effects/explosion.h" 30 30 31 CREATE_FACTORY(GroundTurret, CL_GROUND_TURRET); 32 33 using namespace std; 34 31 CREATE_FACTORY(SpaceTurret, CL_SPACE_TURRET); 35 32 36 33 /** 37 * constructs and loads a GroundTurret from a XML-element34 * constructs and loads a SpaceTurret from a XML-element 38 35 * @param root the XML-element to load from 39 36 */ 40 GroundTurret::GroundTurret(const TiXmlElement* root)37 SpaceTurret::SpaceTurret(const TiXmlElement* root) 41 38 : NPC(root) 42 39 { … … 50 47 * standard deconstructor 51 48 */ 52 GroundTurret::~GroundTurret ()49 SpaceTurret::~SpaceTurret () 53 50 { 54 51 … … 57 54 58 55 /** 59 * initializes the GroundTurret56 * initializes the SpaceTurret 60 57 * @todo change this to what you wish 61 58 */ 62 void GroundTurret::init()59 void SpaceTurret::init() 63 60 { 64 this->setClassID(CL_ GROUND_TURRET, "GroundTurret");61 this->setClassID(CL_SPACE_TURRET, "SpaceTurret"); 65 62 this->loadModel("models/ground_turret_#.obj", 5); 63 this->loadModel("models/comet.obj", .5, 3); 66 64 this->left = NULL; 67 65 this->right = NULL; … … 80 78 81 79 /** 82 * loads a GroundTurret from a XML-element80 * loads a SpaceTurret from a XML-element 83 81 * @param root the XML-element to load from 84 82 * @todo make the class Loadable 85 83 */ 86 void GroundTurret::loadParams(const TiXmlElement* root)84 void SpaceTurret::loadParams(const TiXmlElement* root) 87 85 { 88 86 // all the clases this Entity is directly derived from must be called in this way, to load all settings. … … 121 119 122 120 /** 123 * advances the GroundTurret about time seconds121 * advances the SpaceTurret about time seconds 124 122 * @param time the Time to step 125 123 */ 126 void GroundTurret::tick(float dt)124 void SpaceTurret::tick(float dt) 127 125 { 128 126 if(this->getHealth() > 0.0f && State::getPlayer() && … … 146 144 * draws this worldEntity 147 145 */ 148 void GroundTurret::draw () const146 void SpaceTurret::draw () const 149 147 { 150 WorldEntity::draw(); 148 glPushMatrix(); 149 glTranslatef (this->getAbsCoor ().x, 150 this->getAbsCoor ().y, 151 this->getAbsCoor ().z); 152 153 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 154 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 155 156 this->getModel()->draw(); 157 if (this->getModel() != NULL) 158 this->getModel(3)->draw(); 159 glPopMatrix(); 151 160 152 161 if (this->left != NULL) … … 162 171 * 163 172 */ 164 void GroundTurret::postSpawn ()173 void SpaceTurret::postSpawn () 165 174 { 166 175 … … 171 180 * 172 181 */ 173 void GroundTurret::leftWorld ()182 void SpaceTurret::leftWorld () 174 183 { 175 184 176 185 } 177 186 178 void GroundTurret::destroy(WorldEntity* killer)187 void SpaceTurret::destroy(WorldEntity* killer) 179 188 { 180 189 this->setAbsDirSoft(Quaternion(-90, Vector(0,0,1)), 90);
Note: See TracChangeset
for help on using the changeset viewer.