Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8898 in orxonox.OLD


Ignore:
Timestamp:
Jun 29, 2006, 1:03:37 AM (18 years ago)
Author:
patrick
Message:

material displayed now and better

Location:
branches/single_player_map/src/world_entities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/single_player_map/src/world_entities/creatures/fps_player.cc

    r8897 r8898  
    121121
    122122  this->getWeaponManager().setSlotCount(2);
    123   this->getWeaponManager().setSlotPosition(0, Vector(1.5, -0.7, 0.5));
     123  this->getWeaponManager().setSlotPosition(0, Vector(1.5, -0.7, 1.1));
    124124  this->getWeaponManager().setSlotDirection(0, Quaternion(M_PI_2, Vector(0,1,0)));
    125125  this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
  • branches/single_player_map/src/world_entities/weapons/fps_sniper_rifle.cc

    r8897 r8898  
    6767{
    6868  // model will be deleted from WorldEntity-destructor
     69  if( this->material != NULL)
     70    delete this->material;
    6971}
    7072
     
    7577
    7678  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);
     
    150156
    151157
     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
  • branches/single_player_map/src/world_entities/weapons/fps_sniper_rifle.h

    r8894 r8898  
    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  };
  • branches/single_player_map/src/world_entities/world_entity.cc

    r8894 r8898  
    617617    }
    618618
    619     if( this->aabbNode != NULL)
    620       this->aabbNode->drawBV(0, DRAW_BV_POLYGON, Vector(1, 0.6, 0.2), true);
     619//     if( this->aabbNode != NULL)
     620//       this->aabbNode->drawBV(0, DRAW_BV_POLYGON, Vector(1, 0.6, 0.2), true);
    621621
    622622    glPopMatrix();
Note: See TracChangeset for help on using the changeset viewer.