- Timestamp:
- Dec 13, 2017, 11:32:26 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DWeapon.cc
r11668 r11669 91 91 model->setScale(5); 92 92 93 this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition()); 93 //get position and orientation of the ship to know in which direction the projectile needs to fire off 94 Pawn* player = this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn(); 94 95 95 projectile->setOrientation( this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getOrientation());96 projectile->setPosition( this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getPosition());96 projectile->setOrientation(player->getOrientation()); 97 projectile->setPosition(player->getPosition()); 97 98 98 // auf 2D Ebene druecken99 Vector3 muzzle2D = this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getOrientation()* WorldEntity::FRONT;99 //Velocity & position of the projectile must be y = 0 since the game takes place in the x-z plane 100 Vector3 muzzle2D = player->getOrientation()* WorldEntity::FRONT ; 100 101 muzzle2D.y = 0; 101 102 102 projectile->setVelocity(muzzle2D * this->speed_); 103 103
Note: See TracChangeset
for help on using the changeset viewer.