Changeset 8898 in orxonox.OLD for branches/single_player_map/src/world_entities/weapons
- Timestamp:
- Jun 29, 2006, 1:03:37 AM (18 years ago)
- Location:
- branches/single_player_map/src/world_entities/weapons
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/single_player_map/src/world_entities/weapons/fps_sniper_rifle.cc
r8897 r8898 67 67 { 68 68 // model will be deleted from WorldEntity-destructor 69 if( this->material != NULL) 70 delete this->material; 69 71 } 70 72 … … 75 77 76 78 this->loadModel("models/guns/fps_sniper_rifle.obj", 0.2); 79 this->material = new Material(); 80 this->material->setIllum(3); 81 this->material->setAmbient(1.0, 1.0, 1.0); 82 this->material->setDiffuseMap("maps/rifle01tex.jpg"); 77 83 78 84 this->setStateDuration(WS_SHOOTING, .1); … … 150 156 151 157 158 159 /** 160 * this will draw the weapon 161 */ 162 void FPSSniperRifle::draw () const 163 { 164 /* draw gun body */ 165 glMatrixMode(GL_MODELVIEW); 166 glPushMatrix(); 167 glTranslatef (this->getAbsCoor ().x, 168 this->getAbsCoor ().y, 169 this->getAbsCoor ().z); 170 171 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 172 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 173 174 if( this->leftRight == W_RIGHT) 175 glScalef(1.0, 1.0, -1.0); 176 177 this->material->select(); 178 static_cast<StaticModel*>(this->getModel())->draw(); 179 180 glPopMatrix(); 181 182 } 183 184 185 -
branches/single_player_map/src/world_entities/weapons/fps_sniper_rifle.h
r8894 r8898 35 35 36 36 37 class Material; 38 37 39 class FPSSniperRifle : public Weapon 38 40 { … … 50 52 virtual void fire(); 51 53 54 virtual void draw() const; 55 56 52 57 53 58 private: 54 int leftRight; // this will become an enum 59 int leftRight; //!< this will become an enum 60 Material* material; //!< material 55 61 56 62 };
Note: See TracChangeset
for help on using the changeset viewer.