Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 626 for code/branches


Ignore:
Timestamp:
Dec 18, 2007, 8:58:22 PM (17 years ago)
Author:
rgrieder
Message:
  • thruster effects are now only shown when the ship accelerates
Location:
code/branches/FICN/src/orxonox/objects
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/objects/SpaceShip.cc

    r623 r626  
    121121        w->setPositionOfEmitter(1, Vector3(0,-10,10));
    122122
     123        emitterRate_ = w->getRate();
     124
    123125        Ogre::SceneNode* node1 = this->getNode()->createChildSceneNode(this->getName() + "particle1");
    124126        node1->setInheritScale(false);
     
    138140        tt->setPositionOfEmitter(0, Vector3(-15,20,-1));
    139141        tt->setPositionOfEmitter(1, Vector3(-15,-20,-1));
     142        tt->setVelocity(50);
    140143
    141144        Ogre::SceneNode* node2 = this->getNode()->createChildSceneNode(this->getName() + "particle2");
     
    271274        if(moveForward_ <= 0)
    272275        {
    273             accelerationForward_ = brakeForward_;
     276            accelerationForward_ = -brakeForward_;
    274277            if(speedForward_ > 0)
    275                 speedForward_ -= accelerationForward_*dt;
     278                speedForward_ += accelerationForward_*dt;
    276279            if(speedForward_ < 0)
    277280                speedForward_ = 0;
     
    380383        this->pitch(Degree(speedLoopRightLeft_*dt), Ogre::Node::TS_LOCAL);
    381384
     385        if (accelerationForward_ > 25.0)
     386        {
     387          this->tt->setRate(emitterRate_);
     388        }
     389        else
     390        {
     391          this->tt->setRate(0);
     392        }
     393
    382394    }
    383395
  • code/branches/FICN/src/orxonox/objects/SpaceShip.h

    r608 r626  
    7878            float minMouseX;
    7979            bool moved;
     80
     81            int emitterRate_;
    8082    };
    8183}
Note: See TracChangeset for help on using the changeset viewer.