Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6040 in orxonox.OLD


Ignore:
Timestamp:
Dec 11, 2005, 1:34:18 AM (18 years ago)
Author:
manuel
Message:

hopefully we see some colored spheres arounf powerups now

Location:
branches/powerups/src/world_entities/power_ups
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/powerups/src/world_entities/power_ups/laser_power_up.cc

    r5955 r6040  
    2727CREATE_FACTORY(LaserPowerUp, CL_LASER_POWER_UP);
    2828
    29 LaserPowerUp::LaserPowerUp ()
     29LaserPowerUp::LaserPowerUp () : PowerUp(0.0, 1.0, 0.0)
    3030{
    3131  this->init();
    3232}
    3333
    34 LaserPowerUp::LaserPowerUp(const TiXmlElement* root)
     34LaserPowerUp::LaserPowerUp(const TiXmlElement* root) : PowerUp(0.0, 1.0, 0.0)
    3535{
    3636  this->init();
  • branches/powerups/src/world_entities/power_ups/power_up.cc

    r5973 r6040  
    1919#include "power_up.h"
    2020#include "extendable.h"
    21 
     21#include "primitive_model.h"
    2222
    2323using namespace std;
    2424
    25 PowerUp::PowerUp() { }
     25Model* PowerUp::sphereModel = new PrimitiveModel(PRIM_SPHERE, 7, 5);
    2626
    27 PowerUp::~PowerUp () {}
     27PowerUp::PowerUp(float r, float g, float b)
     28{
     29  this->sphereMaterial = new Material;
     30  this->sphereMaterial->setTransparency(.1);
     31  this->sphereMaterial->setDiffuse(r, g, b);
     32}
     33
     34PowerUp::~PowerUp ()
     35{
     36  delete this->sphereMaterial;
     37}
    2838
    2939
     
    4959  this->setVisibiliy(false);
    5060}
     61
     62void PowerUp::draw()
     63{
     64  WorldEntity::draw();
     65  this->sphereMaterial->select();
     66  sphereModel->draw();
     67}
     68
  • branches/powerups/src/world_entities/power_ups/power_up.h

    r5973 r6040  
    99#include "world_entity.h"
    1010
     11class Material;
     12
    1113class PowerUp : public WorldEntity {
    1214
     
    1517  void collidesWith (WorldEntity* entity, const Vector& location);
    1618
     19  void draw();
     20
    1721protected:
    18   PowerUp();
     22  PowerUp(float r, float g, float b);
    1923  virtual ~PowerUp ();
    2024  virtual void hide();
     25
     26  static Model* sphereModel;
     27
     28private:
     29  Material* sphereMaterial;
    2130};
    2231
  • branches/powerups/src/world_entities/power_ups/turret_power_up.cc

    r5955 r6040  
    2727CREATE_FACTORY(TurretPowerUp, CL_TURRET_POWER_UP);
    2828
    29 TurretPowerUp::TurretPowerUp ()
     29TurretPowerUp::TurretPowerUp () : PowerUp(0.0, 1.0, 0.0)
    3030{
    3131  this->init();
    3232}
    3333
    34 TurretPowerUp::TurretPowerUp(const TiXmlElement* root)
     34TurretPowerUp::TurretPowerUp(const TiXmlElement* root) : PowerUp(0.0, 1.0, 0.0)
    3535{
    3636  this->init();
  • branches/powerups/src/world_entities/power_ups/weapon_power_up.cc

    r5988 r6040  
    3030CREATE_FACTORY(WeaponPowerUp, CL_WEAPON_POWER_UP);
    3131
    32 WeaponPowerUp::WeaponPowerUp ()
     32WeaponPowerUp::WeaponPowerUp () : PowerUp(0.0, 1.0, 0.0)
    3333{
    3434  this->init();
    3535}
    3636
    37 WeaponPowerUp::WeaponPowerUp(const TiXmlElement* root)
     37WeaponPowerUp::WeaponPowerUp(const TiXmlElement* root) : PowerUp(0.0, 1.0, 0.0)
    3838{
    3939  this->init();
Note: See TracChangeset for help on using the changeset viewer.