Changeset 6150 for code/branches/presentation2/src/orxonox/weaponsystem
- Timestamp:
- Nov 25, 2009, 4:52:37 PM (15 years ago)
- Location:
- code/branches/presentation2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2
- Property svn:mergeinfo changed
/code/branches/ingamemenu (added) merged: 6003,6018-6020,6022-6023 /code/branches/menu (added) merged: 5941,5944,5952,6024,6032,6036,6047-6049,6051,6145-6146,6148
- Property svn:mergeinfo changed
-
code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.cc
r6112 r6150 196 196 } 197 197 198 void WeaponMode::computeMuzzleParameters( )198 void WeaponMode::computeMuzzleParameters(const Vector3& target) 199 199 { 200 200 if (this->weapon_) … … 204 204 Pawn* pawn = this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn(); 205 205 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_; 212 207 // COUT(0) << "muzzleDirection " << muzzleDirection << endl; 213 208 this->muzzleOrientation_ = (this->weapon_->getWorldOrientation() * WorldEntity::FRONT).getRotationTo(muzzleDirection) * this->weapon_->getWorldOrientation(); -
code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.h
r6108 r6150 109 109 { return this->muzzleOffset_; } 110 110 111 void computeMuzzleParameters( );111 void computeMuzzleParameters(const Vector3& target); 112 112 const Vector3& getMuzzlePosition() const 113 113 { return this->muzzlePosition_; }
Note: See TracChangeset
for help on using the changeset viewer.