Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5766 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Nov 24, 2005, 6:03:24 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the GuidedMissiles to the trunk, without the changed aiming_turret

Location:
trunk/src/world_entities/weapons
Files:
3 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/weapons/projectile.cc

    r5511 r5766  
    3838  this->lifeCycle = 0.0;
    3939  this->lifeSpan = 1.0f; /* sec */
     40  this->target = NULL;
    4041
    4142  this->remove();
     
    9899}
    99100
     101
     102
     103void Projectile::setTarget(PNode* target)
     104{
     105
     106  if (this->target == NULL)
     107     this->target = new PNode();
     108  this->target->setParent(target);
     109}
     110
     111
    100112/**
    101113 * signal tick, time dependent things will be handled here
  • trunk/src/world_entities/weapons/projectile.h

    r5500 r5766  
    3131    inline bool isChageable() { return this->bChargeable; };
    3232
     33    void setTarget(PNode* target);
    3334
    3435    /** @brief This is called, when the Projectile is Emitted */
     
    5455
    5556    Vector                velocity;                  //!< velocity of the projectile.
     57
     58    PNode*                target;                    //!< A target for guided Weapons.
    5659};
    5760
  • trunk/src/world_entities/weapons/turret.cc

    r5750 r5766  
    138138    pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*100.0 + VECTOR_RAND(13)
    139139            /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity());
     140 
    140141
    141142  pj->setParent(NullParent::getInstance());
Note: See TracChangeset for help on using the changeset viewer.