Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9003 in orxonox.OLD for trunk/src/world_entities/weapons


Ignore:
Timestamp:
Jul 2, 2006, 1:36:13 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the single_player_map branche back
merged with command:
svn merge -r8896:HEAD https://svn.orxonox.net/orxonox/branches/single_player_map .
no conflicts

Location:
trunk/src/world_entities/weapons
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/weapons/fps_sniper_rifle.cc

    r8894 r9003  
    6767{
    6868  // model will be deleted from WorldEntity-destructor
     69  if( this->material != NULL)
     70    delete this->material;
    6971}
    7072
     
    7476  this->setClassID(CL_FPS_SNIPER_RIFLE, "FPSSniperRifle");
    7577
    76   this->loadModel("models/guns/fps_sniper_rifle.obj", 0.1);
     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");
    7783
    7884  this->setStateDuration(WS_SHOOTING, .1);
     
    149155
    150156
     157
     158
     159/**
     160 *  this will draw the weapon
     161 */
     162void 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
  • trunk/src/world_entities/weapons/fps_sniper_rifle.h

    r8894 r9003  
    3535
    3636
     37class Material;
     38
    3739class FPSSniperRifle : public Weapon
    3840  {
     
    5052    virtual void fire();
    5153
     54    virtual void draw() const;
     55
     56
    5257
    5358  private:
    54     int leftRight;   // this will become an enum
     59    int              leftRight;   //!< this will become an enum
     60    Material*        material;    //!< material
    5561
    5662  };
Note: See TracChangeset for help on using the changeset viewer.