Changeset 9180 in orxonox.OLD for branches/presentation/src
- Timestamp:
- Jul 5, 2006, 12:49:40 AM (19 years ago)
- Location:
- branches/presentation/src
- Files:
-
- 3 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/defs/class_id.h
r9173 r9180 229 229 CL_BOMB = 0x000003e4, 230 230 CL_GROUND_TURRET = 0x000003e5, 231 CL_GUIDED_MISSILE = 0x000003e6, 232 CL_HYPERBLAST = 0x000003e7, 231 CL_SPACE_TURRET = 0x000003e6, 232 CL_GUIDED_MISSILE = 0x000003e7, 233 CL_HYPERBLAST = 0x000003e8, 233 234 234 235 // NPC's -
branches/presentation/src/story_entities/game_world_data.cc
r9179 r9180 392 392 std::string oggFile = ResourceManager::getFullName(name); 393 393 this->music = new OrxSound::OggPlayer(oggFile); 394 this->music->debug();395 394 if (this->localPlayer != NULL) 396 395 this->localPlayer->hud().notifyUser(std::string("Playing SoundTrack: ") + this->music->artist() + " - " + this->music->title()); -
branches/presentation/src/world_entities/WorldEntities.am
r9173 r9180 4 4 world_entities/npcs/npc_test.cc \ 5 5 world_entities/npcs/ground_turret.cc \ 6 world_entities/npcs/space_turret.cc \ 6 7 world_entities/npcs/generic_npc.cc \ 7 8 world_entities/npcs/door.cc \ … … 74 75 npcs/npc_test1.h \ 75 76 npcs/ground_turret.h \ 77 npcs/space_turret.h \ 76 78 npcs/door.cc \ 77 79 npcs/repair_station.h \ -
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); -
branches/presentation/src/world_entities/npcs/space_turret.h
r9178 r9180 1 1 /*! 2 * @file ground_turret.h2 * @file space_turret.h 3 3 * @brief description 4 4 */ 5 5 6 #ifndef _ GROUND_TURRET_H7 #define _ GROUND_TURRET_H6 #ifndef _SPACE_TURRET_H 7 #define _SPACE_TURRET_H 8 8 9 9 #include "npcs/npc.h" … … 12 12 13 13 //! A Class to ... 14 class GroundTurret : public NPC14 class SpaceTurret : public NPC 15 15 { 16 16 17 18 GroundTurret(const TiXmlElement* root = NULL);19 virtual ~ GroundTurret();17 public: 18 SpaceTurret(const TiXmlElement* root = NULL); 19 virtual ~SpaceTurret(); 20 20 21 void init();22 21 virtual void loadParams(const TiXmlElement* root); 23 22 … … 30 29 virtual void tick(float time); 31 30 32 private: 33 PNode weaponHolder[2]; 34 Weapon *left, *right; 31 private: 32 void init(); 33 34 35 private: 36 PNode weaponHolder[2]; 37 Weapon *left, *right; 35 38 }; 36 39 37 #endif /* _ GROUND_TURRET_H */40 #endif /* _SPACE_TURRET_H */
Note: See TracChangeset
for help on using the changeset viewer.