- Timestamp:
- Nov 27, 2005, 7:10:01 PM (19 years ago)
- Location:
- branches/world_entities/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/world_entities/src/lib/graphics/spatial_separation/quadtree_node.h
r5430 r5801 16 16 17 17 #include "base_object.h" 18 #include "vector.h" 18 19 19 #include "abstract_model.h" 20 20 -
branches/world_entities/src/util/loading/game_loader.cc
r5553 r5801 357 357 } 358 358 359 PRINTF(2)("Fabricate failed, Ti XmlElement did not contain a value\n");359 PRINTF(2)("Fabricate failed, TiElement did not contain a value\n"); 360 360 361 361 return NULL; -
branches/world_entities/src/world_entities/weapons/ground_turret.cc
r5797 r5801 81 81 * @todo: make the class Loadable 82 82 */ 83 // LoadParamXML(root, "Weapons", this, GroundTurret, loadWeapon); 83 const TiXmlElement* element; 84 85 element = root->FirstChildElement("weapon-left"); 86 if (element != NULL) element = element->FirstChildElement(); 87 this->left = dynamic_cast<Weapon*>( Factory::getFirst()->fabricate( element) ); 88 if (this->left) 89 { 90 this->left->setParent(this); 91 this->left->setRelCoor(0,10,-5); 92 } 93 94 element = root->FirstChildElement("weapon-right"); 95 if (element != NULL) if (element != NULL) element = element->FirstChildElement(); 96 this->right = dynamic_cast<Weapon*>( Factory::getFirst()->fabricate( element) ); 97 if (this->right) 98 { 99 this->right->setParent(this); 100 this->right->setRelCoor(0,10,5); 101 } 84 102 } 85 86 103 87 104 /** … … 113 130 if (this->model) 114 131 this->model->draw(); 115 if (left != NULL) 132 133 glPopMatrix(); 134 if (this->left != NULL) 116 135 this->left->draw(); 117 136 if (this->right != NULL) 118 137 this->right->draw(); 119 120 glPopMatrix();121 138 } 122 139 -
branches/world_entities/src/world_entities/weapons/ground_turret.h
r5797 r5801 22 22 void loadParams(const TiXmlElement* root); 23 23 24 void loadWeapons(const TiXmlElement* root);25 26 24 virtual void postSpawn (); 27 25 virtual void leftWorld (); -
branches/world_entities/src/world_entities/weapons/turret.cc
r5766 r5801 44 44 this->init(); 45 45 46 this->loadModel("models/guns/turret1.obj");47 48 49 46 this->setActionSound(WA_SHOOT, "sound/shot1.wav"); 50 47 this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav"); 51 48 this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav"); 49 50 this->loadModel("models/guns/turret1.obj"); 52 51 } 53 52 … … 72 71 { 73 72 this->setClassID(CL_TURRET, "Turret"); 73 74 74 75 75 Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this); … … 138 138 pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*100.0 + VECTOR_RAND(13) 139 139 /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity()); 140 140 141 141 142 142 pj->setParent(NullParent::getInstance()); … … 154 154 void Turret::draw () const 155 155 { 156 /* draw gun body */ 157 glMatrixMode(GL_MODELVIEW); 158 glPushMatrix(); 159 glTranslatef (this->getAbsCoor ().x, 160 this->getAbsCoor ().y, 161 this->getAbsCoor ().z); 162 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 163 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 156 if (this->model != NULL) 157 { 158 /* draw gun body */ 159 glMatrixMode(GL_MODELVIEW); 160 glPushMatrix(); 161 glTranslatef (this->getAbsCoor ().x, 162 this->getAbsCoor ().y, 163 this->getAbsCoor ().z); 164 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 165 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 164 166 165 this->model->draw(); 166 glPopMatrix(); 167 this->model->draw(); 168 glPopMatrix(); 169 } 167 170 } 168
Note: See TracChangeset
for help on using the changeset viewer.