Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 25, 2009, 4:52:37 PM (15 years ago)
Author:
scheusso
Message:

merged menu branch to presentation2 branch with some additional fixes and features ;)

Location:
code/branches/presentation2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2

  • code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.cc

    r6112 r6150  
    196196    }
    197197
    198     void WeaponMode::computeMuzzleParameters()
     198    void WeaponMode::computeMuzzleParameters(const Vector3& target)
    199199    {
    200200        if (this->weapon_)
     
    204204            Pawn* pawn = this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn();
    205205            Vector3 muzzleDirection;
    206             if ( pawn->getTarget() )
    207             {
    208                 muzzleDirection = pawn->getTarget()->getWorldPosition() - this->muzzlePosition_;
    209             }
    210             else
    211                 muzzleDirection = pawn->getAimPosition() - this->muzzlePosition_;
     206            muzzleDirection = target - this->muzzlePosition_;
    212207//             COUT(0) << "muzzleDirection " << muzzleDirection << endl;
    213208            this->muzzleOrientation_ = (this->weapon_->getWorldOrientation() * WorldEntity::FRONT).getRotationTo(muzzleDirection) * this->weapon_->getWorldOrientation();
  • code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.h

    r6108 r6150  
    109109                { return this->muzzleOffset_; }
    110110
    111             void computeMuzzleParameters();
     111            void computeMuzzleParameters(const Vector3& target);
    112112            const Vector3& getMuzzlePosition() const
    113113                { return this->muzzlePosition_; }
Note: See TracChangeset for help on using the changeset viewer.