Changeset 6173 for code/branches/presentation2/src/orxonox/controllers
- Timestamp:
- Nov 27, 2009, 1:11:53 PM (15 years ago)
- Location:
- code/branches/presentation2/src/orxonox/controllers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc
r6157 r6173 107 107 108 108 if ( this->acceleration_ > 0 ) 109 HumanController::moveFrontBack(Vector2(clamp(this->acceleration_ + this->currentAcceleration_, 0.0f, 1.0f), 0)); 109 { 110 /* 111 if (this->controllableEntity_ && this->controllableEntity_->getEngine()) { 112 std::cout << this->controllableEntity_->getEngine()->getAccelerationFront() << endl; 113 } 114 */ 115 if ( this->accelerating_ ) 116 HumanController::moveFrontBack(Vector2(1, 0)); 117 else 118 HumanController::moveFrontBack(Vector2(this->acceleration_, 0)); 119 this->accelerating_ = false; 120 //HumanController::moveFrontBack(Vector2(clamp(this->acceleration_ + this->currentAcceleration_, 0.0f, 1.0f), 0)); 121 } 110 122 } 111 123 … … 239 251 void NewHumanController::frontback(const Vector2& value) 240 252 { 241 this-> currentAcceleration_ = value.x;242 243 if (this->acceleration_ == 0)253 this->accelerating_ = true; 254 255 //if (this->acceleration_ == 0) 244 256 HumanController::frontback(value); 245 257 } … … 285 297 if ( NewHumanController::localController_s ) 286 298 { 287 NewHumanController::localController_s->acceleration_ += 0.08; 288 NewHumanController::localController_s->acceleration_ = clamp(NewHumanController::localController_s->acceleration_ + 0.08f, 0.0f, 1.0f); 299 NewHumanController::localController_s->acceleration_ = clamp(NewHumanController::localController_s->acceleration_ + 0.2f, 0.00f, 1.0f); 289 300 } 290 301 } … … 294 305 if ( NewHumanController::localController_s ) 295 306 { 296 NewHumanController::localController_s->acceleration_ = clamp(NewHumanController::localController_s->acceleration_ - 0. 05f, 0.0f, 1.0f);307 NewHumanController::localController_s->acceleration_ = clamp(NewHumanController::localController_s->acceleration_ - 0.1f, 0.0f, 1.0f); 297 308 } 298 309 } -
code/branches/presentation2/src/orxonox/controllers/NewHumanController.h
r6149 r6173 70 70 OrxonoxOverlay* crossHairOverlay_; 71 71 float overlaySize_; 72 float currentAcceleration_;72 bool accelerating_; 73 73 float acceleration_; 74 74 ClassTreeMask targetMask_;
Note: See TracChangeset
for help on using the changeset viewer.