Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 21, 2010, 10:25:27 AM (14 years ago)
Author:
scheusso
Message:

merged rocket branch into presentation3 and cleaned up some things (mostly debug output and intendation)

Location:
code/branches/presentation3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3

  • code/branches/presentation3/src/modules/weapons/weaponmodes/SimpleRocketFire.cc

    r6950 r6951  
    6161    void SimpleRocketFire::fire()
    6262    {
    63                 RocketController* con = new RocketController(this);
    64                 SimpleRocket* rocket = con->getRocket();
    65                 this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
    66 //              rocket->setOrientation(this->getMuzzleOrientation());
     63        RocketController* con = new RocketController(this);
     64        SimpleRocket* rocket = con->getRocket();
     65        this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
     66//      rocket->setOrientation(this->getMuzzleOrientation());
    6767        rocket->setOrientation(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getWorldOrientation());
    68                 Vector3 pos = this->getMuzzlePosition();
     68        Vector3 pos = this->getMuzzlePosition();
    6969        rocket->setPosition(pos);
    70 //              rocket->setAcceleration(20*rocket->getOrientation() * WorldEntity::FRONT);
    71                 rocket->setVelocity(this->getMuzzleDirection()*this->speed_);
    72                 rocket->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
    73                 rocket->setDamage(this->damage_);
    74                 WorldEntity* pawnn=this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getTarget();
    75                 if (pawnn) {
    76                 con->setTarget(pawnn);
    77                 }
     70//      rocket->setAcceleration(20*rocket->getOrientation() * WorldEntity::FRONT);
     71        rocket->setVelocity(this->getMuzzleDirection()*this->speed_);
     72        rocket->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
     73        rocket->setDamage(this->damage_);
     74        WorldEntity* pawnn=static_cast<ControllableEntity*>(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn())->getTarget();
     75        if (pawnn)
     76        {
     77            con->setTarget(pawnn);
     78        }
    7879    }
    7980}
Note: See TracChangeset for help on using the changeset viewer.