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).
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  
    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
  • code/branches/objecthierarchy/src/orxonox/objects/controllers/HumanController.h

    r1993 r2001  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "util/Math.h"
    3435#include "Controller.h"
    3536
     
    4243            virtual ~HumanController();
    4344
    44             static void moveFrontBack(float value);
    45             static void moveRightLeft(float value);
    46             static void moveUpDown(float value);
     45            static void moveFrontBack(const Vector2& value);
     46            static void moveRightLeft(const Vector2& value);
     47            static void moveUpDown(const Vector2& value);
    4748
    48             static void rotateYaw(float value);
    49             static void rotatePitch(float value);
    50             static void rotateRoll(float value);
     49            static void rotateYaw(const Vector2& value);
     50            static void rotatePitch(const Vector2& value);
     51            static void rotateRoll(const Vector2& value);
    5152
    5253            static void fire();
  • code/branches/objecthierarchy/src/orxonox/objects/worldentities/pawns/Spectator.cc

    r1994 r2001  
    6666        this->setVelocity(velocity * this->speed_);
    6767
    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_));
    7172
    7273        this->yaw_ = this->pitch_ = this->roll_ = 0;
Note: See TracChangeset for help on using the changeset viewer.