Changeset 6329
- Timestamp:
- Dec 12, 2009, 7:54:12 PM (15 years ago)
- Location:
- code/branches/presentation2/src/orxonox/items
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/orxonox/items/MultiStateEngine.cc
r6328 r6329 71 71 } 72 72 this->state_ = 0; 73 this->steeringDirectionZ_ = 0 ;73 this->steeringDirectionZ_ = 0.0; 74 74 75 75 this->setSyncMode(ObjectDirection::Bidirectional); … … 115 115 { 116 116 if (this->getShip()->hasLocalController()) 117 this->steeringDirectionZ_ = (int)this->getDirection().z;117 this->steeringDirectionZ_ = this->getDirection().z; 118 118 if (GameMode::isMaster()) 119 119 { … … 121 121 122 122 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); 124 124 125 125 int newState = 0; … … 134 134 defEngineSndNormal_->setPitch(clamp(pitch/MAX_VELOCITY_NORMAL + 1, 0.5f, 2.0f)); 135 135 } 136 else if (this->steeringDirectionZ_ > 0 && velocity.z <0)136 else if (this->steeringDirectionZ_ > 0.0 && velocity.z < 0.0) 137 137 newState = Brake; 138 138 else -
code/branches/presentation2/src/orxonox/items/MultiStateEngine.h
r6327 r6329 71 71 72 72 private: 73 int steeringDirectionZ_;73 float steeringDirectionZ_; 74 74 int state_; 75 75 LuaState* lua_;
Note: See TracChangeset
for help on using the changeset viewer.