Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 12, 2009, 7:54:12 PM (15 years ago)
Author:
rgrieder
Message:

Who the hell uses ints to synchronise part of a float vector? Well, I really don't know…

Location:
code/branches/presentation2/src/orxonox/items
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/items/MultiStateEngine.cc

    r6328 r6329  
    7171        }
    7272        this->state_ = 0;
    73         this->steeringDirectionZ_ = 0;
     73        this->steeringDirectionZ_ = 0.0;
    7474
    7575        this->setSyncMode(ObjectDirection::Bidirectional);
     
    115115        {
    116116            if (this->getShip()->hasLocalController())
    117                 this->steeringDirectionZ_ = (int)this->getDirection().z;
     117                this->steeringDirectionZ_ = this->getDirection().z;
    118118            if (GameMode::isMaster())
    119119            {
     
    121121
    122122                float pitch = velocity.length();
    123                 bool forward = (this->steeringDirectionZ_ < 0 && velocity.z < -FORWARD_EFFECT_VELOCITY_THRESHOLD);
     123                bool forward = (this->steeringDirectionZ_ < 0.0 && velocity.z < -FORWARD_EFFECT_VELOCITY_THRESHOLD);
    124124
    125125                int newState = 0;
     
    134134                    defEngineSndNormal_->setPitch(clamp(pitch/MAX_VELOCITY_NORMAL + 1, 0.5f, 2.0f));
    135135                }
    136                 else if (this->steeringDirectionZ_ > 0 && velocity.z < 0)
     136                else if (this->steeringDirectionZ_ > 0.0 && velocity.z < 0.0)
    137137                    newState = Brake;
    138138                else
  • code/branches/presentation2/src/orxonox/items/MultiStateEngine.h

    r6327 r6329  
    7171
    7272        private:
    73             int steeringDirectionZ_;
     73            float steeringDirectionZ_;
    7474            int state_;
    7575            LuaState* lua_;
Note: See TracChangeset for help on using the changeset viewer.