Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 27, 2008, 8:07:29 AM (17 years ago)
Author:
rgrieder
Message:

updated input branch

Location:
code/branches/input/src/core
Files:
3 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • code/branches/input/src/core/BaseObject.cc

    r1505 r1629  
    4545        @brief Constructor: Registers the object in the BaseObject-list.
    4646    */
    47     BaseObject::BaseObject() :
    48       bActive_(true),
    49       bVisible_(true),
    50       level_(0),
    51       namespace_(0)
     47    BaseObject::BaseObject() : bInitialized_(false)
    5248    {
    5349        RegisterRootObject(BaseObject);
     50
     51        this->bInitialized_ = true;
     52
     53        this->bActive_ = true;
     54        this->bVisible_ = true;
     55
     56        this->level_ = 0;
     57        this->namespace_ = 0;
    5458    }
    5559
     
    5963    BaseObject::~BaseObject()
    6064    {
    61     }
    62 
    63     /**
    64         @brief load general xml paramters
    65     */
    66     void BaseObject::loadParams(TiXmlElement* xmlElem)
    67     {
    68         if (xmlElem->Attribute("name"))
    69         {
    70             this->setName(xmlElem->Attribute("name"));
    71         }
    7265    }
    7366
     
    8174    {
    8275        XMLPortParam(BaseObject, "name", setName, getName, xmlelement, mode);
     76        XMLPortParam(BaseObject, "visible", setVisible, isVisible, xmlelement, mode);
     77        XMLPortParam(BaseObject, "active", setActive, isActive, xmlelement, mode);
    8378    }
    8479
  • code/branches/input/src/core/BaseObject.h

    r1505 r1629  
    4747    class _CoreExport BaseObject : virtual public OrxonoxClass
    4848    {
     49        friend class WorldEntity;
     50
    4951        public:
    5052            BaseObject();
    5153            virtual ~BaseObject();
    52             virtual void loadParams(TiXmlElement* xmlElem);
    5354            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     55
     56            /** @brief Returns if the object was initialized (passed the object registration). @return True was the object is initialized */
     57            inline bool isInitialized() const { return this->bInitialized_; }
    5458
    5559            /** @brief Sets the name of the object. @param name The name */
     
    6165
    6266            /** @brief Sets the state of the objects activity. @param bActive True = active */
    63             inline void setActivity(bool bActive) { this->bActive_ = bActive; this->changedActivity(); }
     67            inline void setActive(bool bActive) { this->bActive_ = bActive; this->changedActivity(); }
    6468            /** @brief Returns the state of the objects activity. @return The state of the activity */
    65             inline const bool isActive() const { return this->bActive_; }
     69            inline bool isActive() const { return this->bActive_; }
    6670            /** @brief This function gets called if the activity of the object changes. */
    6771            virtual void changedActivity() {}
    6872
    6973            /** @brief Sets the state of the objects visibility. @param bVisible True = visible */
    70             inline void setVisibility(bool bVisible) { this->bVisible_ = bVisible; this->changedVisibility(); }
     74            inline void setVisible(bool bVisible) { this->bVisible_ = bVisible; this->changedVisibility(); }
    7175            /** @brief Returns the state of the objects visibility. @return The state of the visibility */
    72             inline const bool isVisible() const { return this->bVisible_; }
     76            inline bool isVisible() const { return this->bVisible_; }
    7377            /** @brief This function gets called if the visibility of the object changes. */
    7478            virtual void changedVisibility() {}
     
    9094        private:
    9195            std::string name_;                          //!< The name of the object
     96            bool bInitialized_;                         //!< True if the object was initialized (passed the object registration)
    9297            bool bActive_;                              //!< True = the object is active
    9398            bool bVisible_;                             //!< True = the object is visible
  • code/branches/input/src/core/CMakeLists.txt

    r1543 r1629  
    5353GET_TARGET_PROPERTY(TOLUA_EXE tolua LOCATION)
    5454ADD_CUSTOM_COMMAND(
    55   OUTPUT tolua/tolua_bind.cc tolua/tolua_bind.h
     55  OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/tolua/tolua_bind.cc
    5656  COMMAND ${TOLUA_EXE} -n core -o ../../src/core/tolua/tolua_bind.cc -H ../../src/core/tolua/tolua_bind.h ../../src/core/tolua/tolua.pkg
    5757  DEPENDS tolua
     
    6565  ${OGRE_LIBRARIES}
    6666  cpptcl
     67  ois_orxonox
    6768  tinyxml
    6869  tolualib
    69   ois
    7070  util
    7171  ${Boost_thread_LIBRARIES}
  • code/branches/input/src/core/CommandEvaluation.cc

    r1543 r1629  
    7878        if (this->bEvaluatedParams_ && this->function_)
    7979        {
    80             COUT(4) << "CE_execute (evaluation): " << this->function_->getName() << " " << this->param_[0] << " " << this->param_[1] << " " << this->param_[2] << " " << this->param_[3] << " " << this->param_[4] << std::endl;
     80            COUT(5) << "CE_execute (evaluation): " << this->function_->getName() << " " << this->param_[0] << " " << this->param_[1] << " " << this->param_[2] << " " << this->param_[3] << " " << this->param_[4] << std::endl;
    8181            (*this->function_)(this->param_[0], this->param_[1], this->param_[2], this->param_[3], this->param_[4]);
    8282            return true;
  • code/branches/input/src/core/ConsoleCommand.h

    r1543 r1629  
    3333
    3434#include "Executor.h"
    35 #include "ClassManager.h"
     35#include "Identifier.h"
    3636#include "CommandExecutor.h"
    3737#include "ArgumentCompletionFunctions.h"
  • code/branches/input/src/core/Executor.cc

    r1505 r1629  
    3030#include "Executor.h"
    3131#include "util/Math.h"
     32#include "util/Convert.h"
    3233#include "Language.h"
    3334
     
    136137            {
    137138                std::string paramnumber;
    138                 if (!Convert::ToString(&paramnumber, param))
     139                if (!convertValue(&paramnumber, param))
    139140                    return (*this);
    140141
  • code/branches/input/src/core/Iterator.h

    r1543 r1629  
    9292            {
    9393                this->element_ = element;
     94                return *this;
    9495            }
    9596
  • code/branches/input/src/core/Loader.cc

    r1505 r1629  
    116116        Script::run();*/
    117117        Script* lua = Script::getInstance();
     118        lua->clearLuaOutput();
    118119        lua->loadFile(level->getFile(), true);
    119120        lua->run();
  • code/branches/input/src/core/Script.cc

    r1505 r1629  
    3939}
    4040
    41 #include "tolua++.h"
     41#include "tolua/tolua++.h"
    4242#include "tolua/tolua_bind.h"
    4343
  • code/branches/input/src/core/Script.h

    r1505 r1629  
    7272    inline std::string getLuaOutput() { return output_; };
    7373    //inline std::string* getFileString() { return &fileString_; };
     74    inline void clearLuaOutput() { output_ = ""; }
    7475
    7576    unsigned int getNextQuote(const std::string& text, unsigned int start);
  • code/branches/input/src/core/TclThreadManager.h

    r1535 r1629  
    4545namespace orxonox
    4646{
    47     class boost::thread;
    48 
    4947    struct _CoreExport TclInterpreterBundle
    5048    {
  • code/branches/input/src/core/XMLPort.h

    r1505 r1629  
    152152                                this->parseResult_ = PR_waiting_for_default_values;
    153153                        }
     154                        else
     155                            this->parseResult_ = PR_waiting_for_default_values;
    154156                    }
    155157                    catch (ticpp::Exception& ex)
  • code/branches/input/src/core/input/InputInterfaces.h

    r1535 r1629  
    3737#include "core/CorePrereqs.h"
    3838
    39 #include "ois/OIS.h"
     39#include "src/ois/OISKeyboard.h"
     40#include "src/ois/OISMouse.h"
     41#include "src/ois/OISJoyStick.h"
    4042#include "util/Math.h"
    4143
     
    4749    enum Enum
    4850    {
    49       Unassigned    = OIS::KC_UNASSIGNED, 
    50       Escape        = OIS::KC_ESCAPE,     
    51       NumRow1       = OIS::KC_1,           
    52       NumRow2       = OIS::KC_2,           
    53       NumRow3       = OIS::KC_3,           
    54       NumRow4       = OIS::KC_4,           
    55       NumRow5       = OIS::KC_5,           
    56       NumRow6       = OIS::KC_6,           
    57       NumRow7       = OIS::KC_7,           
    58       NumRow8       = OIS::KC_8,           
    59       NumRow9       = OIS::KC_9,           
    60       NumRow0       = OIS::KC_0,           
     51      Unassigned    = OIS::KC_UNASSIGNED,
     52      Escape        = OIS::KC_ESCAPE,
     53      NumRow1       = OIS::KC_1,
     54      NumRow2       = OIS::KC_2,
     55      NumRow3       = OIS::KC_3,
     56      NumRow4       = OIS::KC_4,
     57      NumRow5       = OIS::KC_5,
     58      NumRow6       = OIS::KC_6,
     59      NumRow7       = OIS::KC_7,
     60      NumRow8       = OIS::KC_8,
     61      NumRow9       = OIS::KC_9,
     62      NumRow0       = OIS::KC_0,
    6163      Minus         = OIS::KC_MINUS,           // - on main keyboard
    62       Equals        = OIS::KC_EQUALS,     
     64      Equals        = OIS::KC_EQUALS,
    6365      Back          = OIS::KC_BACK,            // backspace
    64       Tab           = OIS::KC_TAB,         
    65       Q             = OIS::KC_Q,           
    66       W             = OIS::KC_W,           
    67       E             = OIS::KC_E,           
    68       R             = OIS::KC_R,           
    69       T             = OIS::KC_T,           
    70       Y             = OIS::KC_Y,           
    71       U             = OIS::KC_U,           
    72       I             = OIS::KC_I,           
    73       O             = OIS::KC_O,           
    74       P             = OIS::KC_P,           
    75       LeftBracket   = OIS::KC_LBRACKET,   
    76       RightBracket  = OIS::KC_RBRACKET,   
     66      Tab           = OIS::KC_TAB,
     67      Q             = OIS::KC_Q,
     68      W             = OIS::KC_W,
     69      E             = OIS::KC_E,
     70      R             = OIS::KC_R,
     71      T             = OIS::KC_T,
     72      Y             = OIS::KC_Y,
     73      U             = OIS::KC_U,
     74      I             = OIS::KC_I,
     75      O             = OIS::KC_O,
     76      P             = OIS::KC_P,
     77      LeftBracket   = OIS::KC_LBRACKET,
     78      RightBracket  = OIS::KC_RBRACKET,
    7779      Return        = OIS::KC_RETURN,          // Enter on main keyboard
    78       LeftControl   = OIS::KC_LCONTROL,   
    79       A             = OIS::KC_A,           
    80       S             = OIS::KC_S,           
    81       D             = OIS::KC_D,           
    82       F             = OIS::KC_F,           
    83       G             = OIS::KC_G,           
    84       H             = OIS::KC_H,           
    85       J             = OIS::KC_J,           
    86       K             = OIS::KC_K,           
    87       L             = OIS::KC_L,           
    88       Semicolon     = OIS::KC_SEMICOLON,   
    89       Apostrophe    = OIS::KC_APOSTROPHE, 
     80      LeftControl   = OIS::KC_LCONTROL,
     81      A             = OIS::KC_A,
     82      S             = OIS::KC_S,
     83      D             = OIS::KC_D,
     84      F             = OIS::KC_F,
     85      G             = OIS::KC_G,
     86      H             = OIS::KC_H,
     87      J             = OIS::KC_J,
     88      K             = OIS::KC_K,
     89      L             = OIS::KC_L,
     90      Semicolon     = OIS::KC_SEMICOLON,
     91      Apostrophe    = OIS::KC_APOSTROPHE,
    9092      Grave         = OIS::KC_GRAVE,           // accent
    91       LeftShift     = OIS::KC_LSHIFT,     
    92       Backslash     = OIS::KC_BACKSLASH,   
    93       Z             = OIS::KC_Z,           
    94       X             = OIS::KC_X,           
    95       C             = OIS::KC_C,           
    96       V             = OIS::KC_V,           
    97       B             = OIS::KC_B,           
    98       N             = OIS::KC_N,           
    99       M             = OIS::KC_M,           
    100       Comma         = OIS::KC_COMMA,       
     93      LeftShift     = OIS::KC_LSHIFT,
     94      Backslash     = OIS::KC_BACKSLASH,
     95      Z             = OIS::KC_Z,
     96      X             = OIS::KC_X,
     97      C             = OIS::KC_C,
     98      V             = OIS::KC_V,
     99      B             = OIS::KC_B,
     100      N             = OIS::KC_N,
     101      M             = OIS::KC_M,
     102      Comma         = OIS::KC_COMMA,
    101103      Period        = OIS::KC_PERIOD,          // . on main keyboard
    102104      Slash         = OIS::KC_SLASH,           // / on main keyboard
    103       RightShift    = OIS::KC_RSHIFT,     
     105      RightShift    = OIS::KC_RSHIFT,
    104106      Multiply      = OIS::KC_MULTIPLY,        // * on numeric keypad
    105107      LeftAlt       = OIS::KC_LMENU,           // left Alt
    106       Space         = OIS::KC_SPACE,       
    107       CapsLock      = OIS::KC_CAPITAL,     
    108       F1            = OIS::KC_F1,         
    109       F2            = OIS::KC_F2,         
    110       F3            = OIS::KC_F3,         
    111       F4            = OIS::KC_F4,         
    112       F5            = OIS::KC_F5,         
    113       F6            = OIS::KC_F6,         
    114       F7            = OIS::KC_F7,         
    115       F8            = OIS::KC_F8,         
    116       F9            = OIS::KC_F9,         
    117       F10           = OIS::KC_F10,         
    118       Numlock       = OIS::KC_NUMLOCK,     
     108      Space         = OIS::KC_SPACE,
     109      CapsLock      = OIS::KC_CAPITAL,
     110      F1            = OIS::KC_F1,
     111      F2            = OIS::KC_F2,
     112      F3            = OIS::KC_F3,
     113      F4            = OIS::KC_F4,
     114      F5            = OIS::KC_F5,
     115      F6            = OIS::KC_F6,
     116      F7            = OIS::KC_F7,
     117      F8            = OIS::KC_F8,
     118      F9            = OIS::KC_F9,
     119      F10           = OIS::KC_F10,
     120      Numlock       = OIS::KC_NUMLOCK,
    119121      Scrolllock    = OIS::KC_SCROLL,          // Scroll Lock
    120       Numpad7       = OIS::KC_NUMPAD7,     
    121       Numpad8       = OIS::KC_NUMPAD8,     
    122       Numpad9       = OIS::KC_NUMPAD9,     
     122      Numpad7       = OIS::KC_NUMPAD7,
     123      Numpad8       = OIS::KC_NUMPAD8,
     124      Numpad9       = OIS::KC_NUMPAD9,
    123125      NumpadSubtract= OIS::KC_SUBTRACT,        // - on numeric keypad
    124       Numpad4       = OIS::KC_NUMPAD4,     
    125       Numpad5       = OIS::KC_NUMPAD5,     
    126       Numpad6       = OIS::KC_NUMPAD6,     
     126      Numpad4       = OIS::KC_NUMPAD4,
     127      Numpad5       = OIS::KC_NUMPAD5,
     128      Numpad6       = OIS::KC_NUMPAD6,
    127129      NumpadAdd     = OIS::KC_ADD,             // + on numeric keypad
    128       Numpad1       = OIS::KC_NUMPAD1,     
    129       Numpad2       = OIS::KC_NUMPAD2,     
    130       Numpad3       = OIS::KC_NUMPAD3,     
    131       Numpad0       = OIS::KC_NUMPAD0,     
     130      Numpad1       = OIS::KC_NUMPAD1,
     131      Numpad2       = OIS::KC_NUMPAD2,
     132      Numpad3       = OIS::KC_NUMPAD3,
     133      Numpad0       = OIS::KC_NUMPAD0,
    132134      NumpadPeriod  = OIS::KC_DECIMAL,         // . on numeric keypad
    133135      LessThan      = OIS::KC_OEM_102,         // < > | on UK/Germany keyboards
    134       F11           = OIS::KC_F11,         
    135       F12           = OIS::KC_F12,         
     136      F11           = OIS::KC_F11,
     137      F12           = OIS::KC_F12,
    136138      F13           = OIS::KC_F13,             //                     (NEC PC98)
    137139      F14           = OIS::KC_F14,             //                     (NEC PC98)
     
    154156      NextTrack     = OIS::KC_NEXTTRACK,       // Next Track
    155157      NumpadEnter   = OIS::KC_NUMPADENTER,     // Enter on numeric keypad
    156       RightControl  = OIS::KC_RCONTROL,   
     158      RightControl  = OIS::KC_RCONTROL,
    157159      Mute          = OIS::KC_MUTE,            // Mute
    158160      Calculator    = OIS::KC_CALCULATOR,      // Calculator
     
    164166      NumpadComma   = OIS::KC_NUMPADCOMMA,     // , on numeric keypad (NEC PC98)
    165167      Divide        = OIS::KC_DIVIDE,          // / on numeric keypad
    166       SYSRQ         = OIS::KC_SYSRQ,       
     168      SYSRQ         = OIS::KC_SYSRQ,
    167169      RightAlt      = OIS::KC_RMENU,           // right Alt
    168170      Pause         = OIS::KC_PAUSE,           // Pause
     
    254256                std::vector<Vector3> mVectors;
    255257  };*/
    256  
     258
    257259  /**
    258260  * Helper struct to determine which handlers of an object (can implement
  • code/branches/input/src/core/input/InputManager.cc

    r1537 r1629  
    3636
    3737#include <limits.h>
     38
    3839#include "core/CoreIncludes.h"
    3940#include "core/ConfigValueIncludes.h"
     
    4243#include "core/ConsoleCommand.h"
    4344#include "core/Shell.h"               // hack!
     45
    4446#include "InputBuffer.h"
    4547#include "KeyBinder.h"
    4648#include "KeyDetector.h"
    4749#include "CalibratorCallback.h"
     50
     51#include "src/ois/OISException.h"
     52#include "src/ois/OISInputManager.h"
    4853
    4954namespace orxonox
     
    650655      activeHandlers_[iHandler].first->tickInput(dt, activeHandlers_[iHandler].second);
    651656  }
    652    
     657
    653658  void InputManager::_completeCalibration()
    654659  {
  • code/branches/input/src/core/input/InputManager.h

    r1535 r1629  
    4141#include <vector>
    4242
    43 #include "ois/OIS.h"
    4443#include "util/Math.h"
    4544#include "core/OrxonoxClass.h"
  • code/branches/input/src/core/input/KeyBinder.cc

    r1543 r1629  
    234234  void KeyBinder::setConfigValues()
    235235  {
    236     SetConfigValueGeneric(KeyBinder, analogThreshold_, 0.01f)  .description("Threshold for analog axes until which the state is 0.");
     236    SetConfigValueGeneric(KeyBinder, analogThreshold_, 0.05f)  .description("Threshold for analog axes until which the state is 0.");
    237237    SetConfigValueGeneric(KeyBinder, mouseSensitivity_, 1.0f)  .description("Mouse sensitivity.");
    238238    SetConfigValueGeneric(KeyBinder, bDeriveMouseInput_, false).description("Whether or not to derive moues movement for the absolute value.");
    239     SetConfigValueGeneric(KeyBinder, derivePeriod_, 0.5f).description("Accuracy of the mouse input deriver. The higher the more precise, but laggier.");
     239    SetConfigValueGeneric(KeyBinder, derivePeriod_, 0.05f).description("Accuracy of the mouse input deriver. The higher the more precise, but laggier.");
    240240    SetConfigValueGeneric(KeyBinder, mouseSensitivityDerived_, 1.0f).description("Mouse sensitivity if mouse input is derived.");
    241241    SetConfigValueGeneric(KeyBinder, bClipMouse_, true).description("Whether or not to clip absolute value of mouse in non derive mode.");
Note: See TracChangeset for help on using the changeset viewer.