Changeset 6950 for code/branches/rocket/src/modules
- Timestamp:
- May 21, 2010, 9:40:14 AM (15 years ago)
- Location:
- code/branches/rocket/src/modules/weapons
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/rocket/src/modules/weapons/RocketController.cc
r6943 r6950 82 82 void RocketController::setTargetPosition() { 83 83 //this->targetPosition_=this->target_->getWorldPosition(); 84 this->targetPosition_ = getPredictedPosition(this->getControllableEntity()->get Position(),this->getControllableEntity()->getVelocity().length() , this->target_->getPosition(), this->target_->getVelocity());84 this->targetPosition_ = getPredictedPosition(this->getControllableEntity()->getWorldPosition(),this->getControllableEntity()->getVelocity().length() , this->target_->getWorldPosition(), this->target_->getVelocity()); 85 85 } 86 86 void RocketController::moveToTargetPosition() { … … 102 102 float dy = target.y-this->getControllableEntity()->getPosition().y; 103 103 COUT(0)<<"\n diff: "; 104 COUT(0)<<target.x-this->getControllableEntity()->getPosition().x; 105 COUT(0)<<" "; 106 COUT(0)<<target.y-this->getControllableEntity()->getPosition().y; 107 COUT(0)<<" "; 108 COUT(0)<<target.z-this->getControllableEntity()->getPosition().z; 104 COUT(0)<<target-this->getControllableEntity()->getPosition() << endl; 109 105 //COUT(0)<<"\n 2D view: "; 110 106 /* COUT(0)<<this->getControllableEntity()->getPosition().x; … … 117 113 float distance = (target - this->getControllableEntity()->getPosition()).length(); 118 114 //Vector3D diff =target-this->rocket->getPosition(); 119 //COUT(0)<<coord.x;115 COUT(0) << "viewdirection: "<< coord << endl; 120 116 //COUT(0)<<" "; 121 117 //COUT(0)<<coord.y; 122 this->getControllableEntity()->rotateYaw(coord.x*coord.x*coord.x*coord.x); 123 this->getControllableEntity()->rotatePitch(coord.y*coord.y* coord.y*coord.y); 118 this->getControllableEntity()->rotateYaw(-0.8f*sgn(coord.x)*coord.x*coord.x); 119 this->getControllableEntity()->rotatePitch(0.8f*sgn(coord.y)*coord.y*coord.y); 120 // this->getControllableEntity()->rotateYaw(10); 121 // this->getControllableEntity()->rotatePitch(0); 124 122 //this->getControllableEntity()->rotatePitch(rotation.getPitch().valueRadians()); 125 123 //this->getControllableEntity()->rotateYaw(rotation.getYaw().valueRadians()); -
code/branches/rocket/src/modules/weapons/weaponmodes/SimpleRocketFire.cc
r6943 r6950 49 49 this->bParallelReload_ = false; 50 50 this->damage_ = 100; 51 this->speed_ = 1 ;51 this->speed_ = 100; 52 52 53 53 this->setMunitionName("LaserMunition"); … … 64 64 SimpleRocket* rocket = con->getRocket(); 65 65 this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition()); 66 rocket->setOrientation(this->getMuzzleOrientation()); 67 Vector3 pos = this->getMuzzlePosition() + (this->getMuzzleOrientation()* Vector3(-2, -3, -2)); 66 // rocket->setOrientation(this->getMuzzleOrientation()); 67 rocket->setOrientation(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getWorldOrientation()); 68 Vector3 pos = this->getMuzzlePosition(); 68 69 rocket->setPosition(pos); 69 rocket->setAcceleration(20*rocket->getOrientation() * WorldEntity::FRONT);70 // rocket->setAcceleration(20*rocket->getOrientation() * WorldEntity::FRONT); 70 71 rocket->setVelocity(this->getMuzzleDirection()*this->speed_); 71 72 rocket->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
Note: See TracChangeset
for help on using the changeset viewer.