Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2008, 2:10:11 AM (15 years ago)
Author:
landauf
Message:

merged weapon2 branch to presentation

Location:
code/branches/presentation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation

  • code/branches/presentation/src/orxonox/objects/weaponSystem/weapons/LaserGun.cc

    r2097 r2493  
    3434#include "util/Debug.h"
    3535
     36#include "LaserGun.h"
     37
    3638
    3739namespace orxonox
    3840{
     41    CreateFactory(LaserGun);
     42
    3943    LaserGun::LaserGun(BaseObject* creator) : Weapon(creator)
    4044    {
    4145        RegisterObject(LaserGun);
    4246
    43         projectileColor_ = ColourValue(1.0, 1.0, 0.5)
     47        this->speed_ = 1250;
     48
    4449    }
    4550
     
    4853    }
    4954
    50     LaserGun::fire()
     55    void LaserGun::takeBullets()
    5156    {
    52             BillboardProjectile* projectile = new ParticleProjectile(this);
    53             projectile->setColour(this->projectileColor_);
    54             projectile->create();
    55             if (projectile->getClassID() == 0)
    56             {
    57               COUT(3) << "generated projectile with classid 0" <<  std::endl; // TODO: remove this output
    58             }
    59 
    60             projectile->setObjectMode(0x3);
     57//COUT(0) << "LaserGun::takeBullets" << std::endl;
     58        this->munition_->removeBullets(1);
     59        this->bulletTimer(this->bulletLoadingTime_);
    6160    }
    6261
    63     LaserGun::addMunition()
     62    void LaserGun::takeMagazines()
    6463    {
    65         //this->munition_ = ;
     64        this->munition_->removeMagazines(1);
     65        this->magazineTimer(this->magazineLoadingTime_);
    6666    }
    6767
    68     void LaserGun::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     68    void LaserGun::createProjectile()
    6969    {
    70 
    71     }
    72 
    73     ColorValue LaserGun::getProjectileColor()
    74     {
    75         return projectileColor_;
     70//COUT(0) << "LaserGun::createProjectile" << std::endl;
     71        BillboardProjectile* projectile = new ParticleProjectile(this);
     72        projectile->setOrientation(this->getWorldOrientation());
     73        projectile->setPosition(this->getWorldPosition());
     74        projectile->setVelocity(this->getWorldOrientation() * WorldEntity::FRONT * this->speed_);
    7675    }
    7776}
Note: See TracChangeset for help on using the changeset viewer.