Changeset 2001 for code/branches/objecthierarchy/src/orxonox/objects
- Timestamp:
- Oct 23, 2008, 12:15:09 AM (16 years ago)
- Location:
- code/branches/objecthierarchy/src/orxonox/objects
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/objects/controllers/HumanController.cc
r1993 r2001 36 36 namespace orxonox 37 37 { 38 SetConsoleCommand(HumanController, moveFrontBack, true). defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);39 SetConsoleCommand(HumanController, moveRightLeft, true). defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);40 SetConsoleCommand(HumanController, moveUpDown, true). defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);41 SetConsoleCommand(HumanController, rotateYaw, true). defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);42 SetConsoleCommand(HumanController, rotatePitch, true). defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);43 SetConsoleCommand(HumanController, rotateRoll, true). defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);44 SetConsoleCommand(HumanController, fire, true). axisParamIndex(0).keybindMode(KeybindMode::OnHold);45 SetConsoleCommand(HumanController, altFire, true). axisParamIndex(0).keybindMode(KeybindMode::OnHold);38 SetConsoleCommand(HumanController, moveFrontBack, true).setAsInputCommand(); 39 SetConsoleCommand(HumanController, moveRightLeft, true).setAsInputCommand(); 40 SetConsoleCommand(HumanController, moveUpDown, true).setAsInputCommand(); 41 SetConsoleCommand(HumanController, rotateYaw, true).setAsInputCommand(); 42 SetConsoleCommand(HumanController, rotatePitch, true).setAsInputCommand(); 43 SetConsoleCommand(HumanController, rotateRoll, true).setAsInputCommand(); 44 SetConsoleCommand(HumanController, fire, true).keybindMode(KeybindMode::OnHold); 45 SetConsoleCommand(HumanController, altFire, true).keybindMode(KeybindMode::OnHold); 46 46 SetConsoleCommand(HumanController, greet, true); 47 47 SetConsoleCommand(HumanController, use, true); … … 64 64 } 65 65 66 void HumanController::moveFrontBack( floatvalue)66 void HumanController::moveFrontBack(const Vector2& value) 67 67 { 68 68 if (HumanController::localController_s && HumanController::localController_s->pawn_) 69 HumanController::localController_s->pawn_->moveFrontBack(value );69 HumanController::localController_s->pawn_->moveFrontBack(value.y); 70 70 } 71 71 72 void HumanController::moveRightLeft( floatvalue)72 void HumanController::moveRightLeft(const Vector2& value) 73 73 { 74 74 if (HumanController::localController_s && HumanController::localController_s->pawn_) 75 HumanController::localController_s->pawn_->moveRightLeft(value );75 HumanController::localController_s->pawn_->moveRightLeft(value.y); 76 76 } 77 77 78 void HumanController::moveUpDown( floatvalue)78 void HumanController::moveUpDown(const Vector2& value) 79 79 { 80 80 if (HumanController::localController_s && HumanController::localController_s->pawn_) 81 HumanController::localController_s->pawn_->moveUpDown(value );81 HumanController::localController_s->pawn_->moveUpDown(value.y); 82 82 } 83 83 84 void HumanController::rotateYaw( floatvalue)84 void HumanController::rotateYaw(const Vector2& value) 85 85 { 86 86 if (HumanController::localController_s && HumanController::localController_s->pawn_) 87 HumanController::localController_s->pawn_->rotateYaw(value );87 HumanController::localController_s->pawn_->rotateYaw(value.y); 88 88 } 89 89 90 void HumanController::rotatePitch( floatvalue)90 void HumanController::rotatePitch(const Vector2& value) 91 91 { 92 92 if (HumanController::localController_s && HumanController::localController_s->pawn_) 93 HumanController::localController_s->pawn_->rotatePitch(value );93 HumanController::localController_s->pawn_->rotatePitch(value.y); 94 94 } 95 95 96 void HumanController::rotateRoll( floatvalue)96 void HumanController::rotateRoll(const Vector2& value) 97 97 { 98 98 if (HumanController::localController_s && HumanController::localController_s->pawn_) 99 HumanController::localController_s->pawn_->rotateRoll(value );99 HumanController::localController_s->pawn_->rotateRoll(value.y); 100 100 } 101 101 -
code/branches/objecthierarchy/src/orxonox/objects/controllers/HumanController.h
r1993 r2001 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "util/Math.h" 34 35 #include "Controller.h" 35 36 … … 42 43 virtual ~HumanController(); 43 44 44 static void moveFrontBack( floatvalue);45 static void moveRightLeft( floatvalue);46 static void moveUpDown( floatvalue);45 static void moveFrontBack(const Vector2& value); 46 static void moveRightLeft(const Vector2& value); 47 static void moveUpDown(const Vector2& value); 47 48 48 static void rotateYaw( floatvalue);49 static void rotatePitch( floatvalue);50 static void rotateRoll( floatvalue);49 static void rotateYaw(const Vector2& value); 50 static void rotatePitch(const Vector2& value); 51 static void rotateRoll(const Vector2& value); 51 52 52 53 static void fire(); -
code/branches/objecthierarchy/src/orxonox/objects/worldentities/pawns/Spectator.cc
r1994 r2001 66 66 this->setVelocity(velocity * this->speed_); 67 67 68 this->yaw(Radian(this->yaw_ * dt * this->rotationSpeed_)); 69 this->pitch(Radian(this->pitch_ * dt * this->rotationSpeed_)); 70 this->roll(Radian(this->roll_ * dt * this->rotationSpeed_)); 68 // TODO: Check why I have removed *dt (1337) 69 this->yaw(Radian(this->yaw_ * this->rotationSpeed_)); 70 this->pitch(Radian(this->pitch_ * this->rotationSpeed_)); 71 this->roll(Radian(this->roll_ * this->rotationSpeed_)); 71 72 72 73 this->yaw_ = this->pitch_ = this->roll_ = 0;
Note: See TracChangeset
for help on using the changeset viewer.