Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5437 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Oct 26, 2005, 11:01:43 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Sphers Rendered around the Turret-Power-Up (this looks really bad)

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

Legend:

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

    r5435 r5437  
    2020#include "list.h"
    2121
     22#include "primitive_model.h"
     23
    2224using namespace std;
    2325
    2426CREATE_FACTORY(TurretPowerUp);
    25 
    26 GLUquadricObj* TurretPowerUp_sphereObj = NULL;
    27 Material*      TurretPowerUp_sphereMat = NULL;
    28 
    2927
    3028TurretPowerUp::TurretPowerUp ()
     
    4139
    4240
    43 TurretPowerUp::~TurretPowerUp () {
    44 
     41TurretPowerUp::~TurretPowerUp ()
     42{
     43  delete this->sphereModel;
     44  delete this->sphereMaterial;
    4545}
    4646
     
    5151  this->loadModelWithScale("models/guns/turret1.obj", 2.0);
    5252
    53   if (TurretPowerUp_sphereObj == NULL)
    54     TurretPowerUp_sphereObj = gluNewQuadric();
    55   if(TurretPowerUp_sphereMat == NULL)
    56   {
    57     TurretPowerUp_sphereMat = new Material("TurretPowerUp_Sphere");
    58     TurretPowerUp_sphereMat->setTransparency(.1);
    59   }
     53  this->sphereModel = new PrimitiveModel(PRIM_SPHERE, 7, 5);
     54  this->sphereMaterial = new Material;
     55  this->sphereMaterial->setTransparency(.0001);
     56  this->sphereMaterial->setDiffuse(.1, .1, .8);
     57
    6058  this->rotation = Vector(0,1,0);
    61   this->cycle    = 0;
     59  this->cycle    = (float)rand()/RAND_MAX*M_2_PI;
     60  this->shiftDir(Quaternion((float)rand()/RAND_MAX*M_2_PI, this->rotation));
    6261}
    6362
     
    112111  Vector tmpRot = this->getAbsDir().getSpacialAxis();
    113112  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    114   TurretPowerUp_sphereMat->select();
    115 //  gluSphere(TurretPowerUp_sphereObj, 3, 5, 5);
    116113  this->model->draw();
     114
     115  this->sphereMaterial->select();
     116  this->sphereModel->draw();
    117117  glPopMatrix();
    118 
    119118}
    120119
  • trunk/src/world_entities/power_ups/turret_power_up.h

    r5435 r5437  
    2727   Vector              rotation;
    2828   float               cycle;
     29
     30   Model*              sphereModel;
     31   Material*           sphereMaterial;
    2932};
    3033
Note: See TracChangeset for help on using the changeset viewer.