Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 23, 2008, 12:15:09 AM (16 years ago)
Author:
rgrieder
Message:
  • Fixed issue with relative mouse movements.
  • Fixed bug when parsing commands in keybindings.ini
  • Fixed potential framerate dependency with relative movements
  • Simplified the use of a configured input command
  • Changed how parametrised input is handled (superposition and [-1,1]-clamp instead of average).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/orxonox/objects/controllers/HumanController.cc

    r1993 r2001  
    3636namespace orxonox
    3737{
    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);
    4646    SetConsoleCommand(HumanController, greet,         true);
    4747    SetConsoleCommand(HumanController, use,           true);
     
    6464    }
    6565
    66     void HumanController::moveFrontBack(float value)
     66    void HumanController::moveFrontBack(const Vector2& value)
    6767    {
    6868        if (HumanController::localController_s && HumanController::localController_s->pawn_)
    69             HumanController::localController_s->pawn_->moveFrontBack(value);
     69            HumanController::localController_s->pawn_->moveFrontBack(value.y);
    7070    }
    7171
    72     void HumanController::moveRightLeft(float value)
     72    void HumanController::moveRightLeft(const Vector2& value)
    7373    {
    7474        if (HumanController::localController_s && HumanController::localController_s->pawn_)
    75             HumanController::localController_s->pawn_->moveRightLeft(value);
     75            HumanController::localController_s->pawn_->moveRightLeft(value.y);
    7676    }
    7777
    78     void HumanController::moveUpDown(float value)
     78    void HumanController::moveUpDown(const Vector2& value)
    7979    {
    8080        if (HumanController::localController_s && HumanController::localController_s->pawn_)
    81             HumanController::localController_s->pawn_->moveUpDown(value);
     81            HumanController::localController_s->pawn_->moveUpDown(value.y);
    8282    }
    8383
    84     void HumanController::rotateYaw(float value)
     84    void HumanController::rotateYaw(const Vector2& value)
    8585    {
    8686        if (HumanController::localController_s && HumanController::localController_s->pawn_)
    87             HumanController::localController_s->pawn_->rotateYaw(value);
     87            HumanController::localController_s->pawn_->rotateYaw(value.y);
    8888    }
    8989
    90     void HumanController::rotatePitch(float value)
     90    void HumanController::rotatePitch(const Vector2& value)
    9191    {
    9292        if (HumanController::localController_s && HumanController::localController_s->pawn_)
    93             HumanController::localController_s->pawn_->rotatePitch(value);
     93            HumanController::localController_s->pawn_->rotatePitch(value.y);
    9494    }
    9595
    96     void HumanController::rotateRoll(float value)
     96    void HumanController::rotateRoll(const Vector2& value)
    9797    {
    9898        if (HumanController::localController_s && HumanController::localController_s->pawn_)
    99             HumanController::localController_s->pawn_->rotateRoll(value);
     99            HumanController::localController_s->pawn_->rotateRoll(value.y);
    100100    }
    101101
Note: See TracChangeset for help on using the changeset viewer.