Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 27, 2008, 8:07:29 AM (16 years ago)
Author:
rgrieder
Message:

updated input branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/input/src/orxonox/objects/RotatingProjectile.cc

    r1505 r1629  
    3737    CreateFactory(RotatingProjectile);
    3838
    39     RotatingProjectile::RotatingProjectile(SpaceShip* owner) : Projectile(owner)
     39    RotatingProjectile::RotatingProjectile(SpaceShip* owner) : BillboardProjectile(owner)
    4040    {
    4141        RegisterObject(RotatingProjectile);
     
    7373    void RotatingProjectile::tick(float dt)
    7474    {
    75         this->time_ += dt;
     75        if (this->isActive())
     76        {
     77            this->time_ += dt;
    7678
    77         this->rotatingNode1_->setPosition(0, 50 * sin(this->time_ * 20), 50 * cos(this->time_ * 20));
    78         this->rotatingNode2_->setPosition(0, -50 * sin(this->time_ * 20), -50 * cos(this->time_ * 20));
     79            this->rotatingNode1_->setPosition(0, 50 * sin(this->time_ * 20), 50 * cos(this->time_ * 20));
     80            this->rotatingNode2_->setPosition(0, -50 * sin(this->time_ * 20), -50 * cos(this->time_ * 20));
     81        }
    7982
    8083        Projectile::tick(dt);
    8184    }
     85
     86    void RotatingProjectile::changedVisibility()
     87    {
     88        BillboardProjectile::changedVisibility();
     89        this->rotatingBillboard1_.setVisible(this->isVisible());
     90        this->rotatingBillboard2_.setVisible(this->isVisible());
     91    }
    8292}
Note: See TracChangeset for help on using the changeset viewer.