Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

merged weapon2 branch to presentation

Location:
code/branches/presentation
Files:
4 edited
2 copied

Legend:

Unmodified
Added
Removed
  • code/branches/presentation

  • code/branches/presentation/src/orxonox/objects/weaponSystem/weapons/CMakeLists.txt

    r2131 r2493  
    11SET( SRC_FILES
     2  Fusion.cc
    23  LaserGun.cc
    3   Missile.cc
     4#  Missile.cc
    45)
    56
  • code/branches/presentation/src/orxonox/objects/weaponSystem/weapons/Fusion.cc

    r2489 r2493  
    4444    {
    4545        RegisterObject(Fusion);
    46        
     46
    4747        this->speed_ = 1250;
    4848
     
    5555    void Fusion::takeBullets()
    5656    {
    57 COUT(0) << "Fusion::takeBullets" << std::endl;
     57//COUT(0) << "Fusion::takeBullets" << std::endl;
    5858        this->munition_->removeBullets(1);
    5959        this->bulletTimer(this->bulletLoadingTime_);
     
    6868    void Fusion::createProjectile()
    6969    {
    70 COUT(0) << "Fusion::createProjectile" << std::endl;
     70//COUT(0) << "Fusion::createProjectile" << std::endl;
    7171        BillboardProjectile* projectile = new ParticleProjectile(this);
    7272        projectile->setOrientation(this->getWorldOrientation());
    7373        projectile->setPosition(this->getWorldPosition());
    74         projectile->setVelocity(WorldEntity::FRONT * this->speed_);
     74        projectile->setVelocity(this->getWorldOrientation() * WorldEntity::FRONT * this->speed_);
    7575    }
    7676}
  • 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}
  • code/branches/presentation/src/orxonox/objects/weaponSystem/weapons/LaserGun.h

    r2106 r2493  
    3434#include "core/BaseObject.h"
    3535
    36 #include "LaserGunMunition.h"
    37 #include "tools/BillboardSet.h"
     36#include "../munitions/LaserGunMunition.h"
    3837#include "util/Math.h"
     38#include "../Weapon.h"
     39#include "../projectiles/BillboardProjectile.h"
     40#include "../projectiles/ParticleProjectile.h"
    3941
    4042namespace orxonox
     
    4648            virtual ~LaserGun();
    4749
    48             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    49 
    50             ColourValue LaserGun::getProjectileColour();
     50            virtual void takeBullets();
     51            virtual void takeMagazines();
     52            virtual void createProjectile();
    5153
    5254        private:
    53             ColorValue projectileColor_;
    54 
    55 
     55            float speed_;
    5656
    5757    };
Note: See TracChangeset for help on using the changeset viewer.