Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 11, 2009, 5:39:53 PM (15 years ago)
Author:
wirthmi
Message:

First implementation of direction shooting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/steering/src/modules/weapons/weaponmodes/HsW01.cc

    r5929 r6045  
    3939#include "weaponsystem/WeaponPack.h"
    4040#include "weaponsystem/WeaponSystem.h"
     41#include "worldentities/WorldEntity.h"
    4142
    4243namespace orxonox
     
    110111        model->setScale(5);
    111112
    112         projectile->setOrientation(this->getMuzzleOrientation());
     113        //projectile->setOrientation(this->getMuzzleOrientation());
     114        projectile->lookAt(this->getTarget(), WorldEntity::World);
    113115        projectile->setPosition(this->getMuzzlePosition());
    114         projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
     116        projectile->setVelocity((projectile->getOrientation() * Vector3::UNIT_Z) * this->speed_); //getWorldOrientation??
     117        //projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
    115118
    116119        projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
Note: See TracChangeset for help on using the changeset viewer.