Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6282 in orxonox.OLD


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

orxonox/trunk: merged the PowerUps back here

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/lang/base_object.cc

    r6281 r6282  
    7474void BaseObject::setClassID(ClassID classID, const char* className)
    7575{
    76   //  printf("%s(0x%.8X)->%s(0x%.8X)\n", this->className, this->classID, className, classID);
    77   assert (!(this->classID & classID));
     76  //printf("%s(0x%.8X)->%s(0x%.8X)\n", this->className, this->classID, className, classID);
     77  assert (!(this->classID & classID & !CL_MASK_SUBSUPER_CLASS_IDA ));
    7878
    7979  this->classID |= (long)classID;
  • trunk/src/world_entities/extendable.h

    r6113 r6282  
    1717class Extendable : virtual public BaseObject {
    1818
    19  public:
    20 //   Extendable();
    21 //   virtual ~Extendable();
     19  public:
     20   //   virtual ~Extendable();
    2221   virtual bool pickup(PowerUp* powerUp) { return false; };
    2322
    24  private:
     23  protected:
     24    Extendable() { this->setClassID(CL_EXTENDABLE, "Extendable"); };
     25
     26  private:
    2527
    2628};
  • 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.