Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6282 in orxonox.OLD for trunk/src/world_entities/power_ups


Ignore:
Timestamp:
Dec 25, 2005, 4:21:48 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the PowerUps back here

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

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/power_ups/power_up.cc

    r6243 r6282  
    2323using namespace std;
    2424
    25 Model* PowerUp::sphereModel = NULL;
    26 
    2725PowerUp::PowerUp(float r, float g, float b)
    2826{
    2927  this->respawnType = RESPAWN_NONE;
    30   if(!PowerUp::sphereModel) {
    31     PowerUp::sphereModel = new PrimitiveModel(PRIM_SPHERE, 7, 5);
    32   }
     28/*  if(!PowerUp::sphereModel) {*/
     29
     30  Model* sphereModel = new PrimitiveModel(PRIM_SPHERE, 7, 5);
     31
     32  this->setModel(sphereModel);
     33  this->buildObbTree( 4);
    3334  this->sphereMaterial = new Material;
    3435  this->sphereMaterial->setTransparency(.1);
     
    5556    if(dynamic_cast<Extendable*>(entity)->pickup(this))
    5657    {
    57       this->setVisibiliy(false);
     58      this->toList(OM_DEAD_TICK);
    5859    }
    5960  }
     
    6263void PowerUp::draw() const
    6364{
    64   WorldEntity::draw();
    65 
    6665  glMatrixMode(GL_MODELVIEW);
    6766  glPushMatrix();
    68   float matrix[4][4];
    6967
    7068  /* translate */
     
    7270                this->getAbsCoor ().y,
    7371                this->getAbsCoor ().z);
    74   /* rotate */ // FIXME: devise a new Way to rotate this
    75   this->getAbsDir ().matrix (matrix);
    76   glMultMatrixf((float*)matrix);
     72  Vector tmpRot = this->getAbsDir().getSpacialAxis();
     73  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    7774
    78   this->sphereMaterial->select();
    79   sphereModel->draw();
     75   this->sphereMaterial->select();
     76   this->getModel(0)->draw();
    8077
    81   glPopMatrix();
     78   glPopMatrix();
    8279}
    8380
  • trunk/src/world_entities/power_ups/power_up.h

    r6113 r6282  
    3131  virtual void respawn() {};
    3232
    33   static Model* sphereModel;
    34 
    3533private:
    3634  Material* sphereMaterial;
Note: See TracChangeset for help on using the changeset viewer.