Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5765 in orxonox.OLD


Ignore:
Timestamp:
Nov 24, 2005, 5:24:39 PM (18 years ago)
Author:
bensch
Message:

orxonox/branches/guidedmissile: more balanced

Location:
branches/guidedmissile/src/world_entities/weapons
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/guidedmissile/src/world_entities/weapons/aiming_turret.cc

    r5764 r5765  
    8484  animation2->setInfinity(ANIM_INF_CONSTANT);
    8585
    86   this->setStateDuration(WS_SHOOTING, .1);
    87   this->setStateDuration(WS_RELOADING, .1);
     86  this->setStateDuration(WS_SHOOTING, 1.0);
     87  this->setStateDuration(WS_RELOADING, 2.0);
    8888  this->setStateDuration(WS_ACTIVATING, .4);
    8989  this->setStateDuration(WS_DEACTIVATING, .4);
     
    127127  direction.normalize();
    128128
    129   if (likely (this->getParent() != NULL))
    130     quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
    131   else
    132     quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
     129//   if (likely (this->getParent() != NULL))
     130//     quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
     131//   else
     132//     quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
    133133
    134   this->setAbsDirSoft(quat, 5);
     134   quat = Quaternion(.5, Vector(0,0,1));
     135
     136  this->setRelDir(quat);
    135137
    136138  this->target->tick(dt);
     
    143145    return;
    144146
    145     pj->setVelocity(/*this->getVelocity()+*/(this->getAbsDir().apply(Vector(1,0,0))*250.0 + VECTOR_RAND(13)
     147    pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*50.0 + VECTOR_RAND(13)
    146148            /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity());
    147149    pj->setTarget(this->target->getParent());
  • branches/guidedmissile/src/world_entities/weapons/guided_missile.cc

    r5764 r5765  
    2929#include "particle_system.h"
    3030
     31
     32#include "null_parent.h"
    3133
    3234using namespace std;
     
    4951  this->lifeSpan = 5;
    5052  this->agility = 5;
     53  this->maxVelocity = 100;
    5154
    5255  this->emitter = new ParticleEmitter(Vector(0,1,0), M_2_PI, 100, 5);
     
    150153{
    151154  //Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.1);
    152   float speed = velocity.len();
    153   if (target != NULL)
     155  if (target != NULL && target->getParent() != NullParent::getInstance())
    154156   {
    155157     velocity += ((target->getAbsCoor() - this->getAbsCoor()).getNormalized())*agility;
    156      velocity *= speed/velocity.len();
     158     float speed = velocity.len();
     159     if (speed > this->maxVelocity)
     160       velocity *= maxVelocity/speed;
     161
     162     this->setAbsDir(Quaternion(velocity, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)));
    157163   }
    158164  Vector v = this->velocity * (time);
     
    172178/**
    173179 *  the function gets called, when the projectile is destroyed
    174 */
     180 */
    175181void GuidedMissile::destroy ()
    176182{
     
    200206
    201207  glPopMatrix();
    202 }
    203 
     208
     209}
     210
  • branches/guidedmissile/src/world_entities/weapons/guided_missile.h

    r5764 r5765  
    4040    ParticleEmitter*                  emitter;
    4141    float                             agility;
     42    float                             maxVelocity;
    4243
    4344    WorldEntity* hitEntity; // FIXME TEMPORARY
Note: See TracChangeset for help on using the changeset viewer.