Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Location:
code/branches/rocket/src/modules/weapons
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/rocket/src/modules/weapons/RocketController.cc

    r6950 r6948  
    8282        void RocketController::setTargetPosition() {
    8383                //this->targetPosition_=this->target_->getWorldPosition();
    84                 this->targetPosition_ = getPredictedPosition(this->getControllableEntity()->getWorldPosition(),this->getControllableEntity()->getVelocity().length() , this->target_->getWorldPosition(), this->target_->getVelocity());
     84                this->targetPosition_ = getPredictedPosition(this->getControllableEntity()->getPosition(),this->getControllableEntity()->getVelocity().length() , this->target_->getPosition(), this->target_->getVelocity());
    8585        }
    8686        void RocketController::moveToTargetPosition() {
     
    102102           float dy = target.y-this->getControllableEntity()->getPosition().y;
    103103           COUT(0)<<"\n diff: ";
    104            COUT(0)<<target-this->getControllableEntity()->getPosition() << endl;
     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;
    105109           //COUT(0)<<"\n 2D view: ";
    106110          /* COUT(0)<<this->getControllableEntity()->getPosition().x;
     
    113117        float distance = (target - this->getControllableEntity()->getPosition()).length();
    114118                //Vector3D diff =target-this->rocket->getPosition();
    115                 COUT(0) << "viewdirection: "<< coord << endl;
     119                //COUT(0)<<coord.x;
    116120                //COUT(0)<<"  ";
    117121                //COUT(0)<<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);
     122                 this->getControllableEntity()->rotateYaw(coord.x*coord.x*coord.x*coord.x);
     123            this->getControllableEntity()->rotatePitch(coord.y*coord.y* coord.y*coord.y);
    122124                //this->getControllableEntity()->rotatePitch(rotation.getPitch().valueRadians());
    123125                //this->getControllableEntity()->rotateYaw(rotation.getYaw().valueRadians());
  • code/branches/rocket/src/modules/weapons/projectiles/SimpleRocket.cc

    r6950 r6948  
    8181            this->setCollisionType(Kinematic);
    8282
    83             // TODO: fix the orientation and size of this collision shape to match the rocket
    8483            ConeCollisionShape* collisionShape = new ConeCollisionShape(this);
    8584            collisionShape->setRadius(3);
    86             collisionShape->setHeight(5);
     85            collisionShape->setHeight(500);
    8786            this->attachCollisionShape(collisionShape);
    8887
     
    9796            this->setAngularVelocity(this->getOrientation() * this->localAngularVelocity_);
    9897            this->setVelocity( this->getOrientation()*WorldEntity::FRONT*this->getVelocity().length() );
    99             this->localAngularVelocity_ = 0;
    10098
    10199            if( this->bDestroy_ )
  • code/branches/rocket/src/modules/weapons/weaponmodes/SimpleRocketFire.cc

    r6950 r6948  
    4949        this->bParallelReload_ = false;
    5050        this->damage_ = 100;
    51         this->speed_ = 100;
     51        this->speed_ = 1;
    5252
    5353        this->setMunitionName("LaserMunition");
     
    6464                SimpleRocket* rocket = con->getRocket();
    6565                this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
    66 //              rocket->setOrientation(this->getMuzzleOrientation());
    67         rocket->setOrientation(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getWorldOrientation());
    68                 Vector3 pos = this->getMuzzlePosition();
     66                rocket->setOrientation(this->getMuzzleOrientation());
     67                Vector3 pos = this->getMuzzlePosition() + (this->getMuzzleOrientation()* Vector3(-2, -3, -2));
    6968        rocket->setPosition(pos);
    70 //              rocket->setAcceleration(20*rocket->getOrientation() * WorldEntity::FRONT);
     69                rocket->setAcceleration(20*rocket->getOrientation() * WorldEntity::FRONT);
    7170                rocket->setVelocity(this->getMuzzleDirection()*this->speed_);
    7271                rocket->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
Note: See TracChangeset for help on using the changeset viewer.