Changeset 1629 for code/branches/input/src/core
- Timestamp:
- Jun 27, 2008, 8:07:29 AM (17 years ago)
- Location:
- code/branches/input/src/core
- Files:
-
- 3 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/input/src/core/BaseObject.cc
r1505 r1629 45 45 @brief Constructor: Registers the object in the BaseObject-list. 46 46 */ 47 BaseObject::BaseObject() : 48 bActive_(true), 49 bVisible_(true), 50 level_(0), 51 namespace_(0) 47 BaseObject::BaseObject() : bInitialized_(false) 52 48 { 53 49 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; 54 58 } 55 59 … … 59 63 BaseObject::~BaseObject() 60 64 { 61 }62 63 /**64 @brief load general xml paramters65 */66 void BaseObject::loadParams(TiXmlElement* xmlElem)67 {68 if (xmlElem->Attribute("name"))69 {70 this->setName(xmlElem->Attribute("name"));71 }72 65 } 73 66 … … 81 74 { 82 75 XMLPortParam(BaseObject, "name", setName, getName, xmlelement, mode); 76 XMLPortParam(BaseObject, "visible", setVisible, isVisible, xmlelement, mode); 77 XMLPortParam(BaseObject, "active", setActive, isActive, xmlelement, mode); 83 78 } 84 79 -
code/branches/input/src/core/BaseObject.h
r1505 r1629 47 47 class _CoreExport BaseObject : virtual public OrxonoxClass 48 48 { 49 friend class WorldEntity; 50 49 51 public: 50 52 BaseObject(); 51 53 virtual ~BaseObject(); 52 virtual void loadParams(TiXmlElement* xmlElem);53 54 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_; } 54 58 55 59 /** @brief Sets the name of the object. @param name The name */ … … 61 65 62 66 /** @brief Sets the state of the objects activity. @param bActive True = active */ 63 inline void setActiv ity(bool bActive) { this->bActive_ = bActive; this->changedActivity(); }67 inline void setActive(bool bActive) { this->bActive_ = bActive; this->changedActivity(); } 64 68 /** @brief Returns the state of the objects activity. @return The state of the activity */ 65 inline constbool isActive() const { return this->bActive_; }69 inline bool isActive() const { return this->bActive_; } 66 70 /** @brief This function gets called if the activity of the object changes. */ 67 71 virtual void changedActivity() {} 68 72 69 73 /** @brief Sets the state of the objects visibility. @param bVisible True = visible */ 70 inline void setVisib ility(bool bVisible) { this->bVisible_ = bVisible; this->changedVisibility(); }74 inline void setVisible(bool bVisible) { this->bVisible_ = bVisible; this->changedVisibility(); } 71 75 /** @brief Returns the state of the objects visibility. @return The state of the visibility */ 72 inline constbool isVisible() const { return this->bVisible_; }76 inline bool isVisible() const { return this->bVisible_; } 73 77 /** @brief This function gets called if the visibility of the object changes. */ 74 78 virtual void changedVisibility() {} … … 90 94 private: 91 95 std::string name_; //!< The name of the object 96 bool bInitialized_; //!< True if the object was initialized (passed the object registration) 92 97 bool bActive_; //!< True = the object is active 93 98 bool bVisible_; //!< True = the object is visible -
code/branches/input/src/core/CMakeLists.txt
r1543 r1629 53 53 GET_TARGET_PROPERTY(TOLUA_EXE tolua LOCATION) 54 54 ADD_CUSTOM_COMMAND( 55 OUTPUT tolua/tolua_bind.cc tolua/tolua_bind.h55 OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/tolua/tolua_bind.cc 56 56 COMMAND ${TOLUA_EXE} -n core -o ../../src/core/tolua/tolua_bind.cc -H ../../src/core/tolua/tolua_bind.h ../../src/core/tolua/tolua.pkg 57 57 DEPENDS tolua … … 65 65 ${OGRE_LIBRARIES} 66 66 cpptcl 67 ois_orxonox 67 68 tinyxml 68 69 tolualib 69 ois70 70 util 71 71 ${Boost_thread_LIBRARIES} -
code/branches/input/src/core/CommandEvaluation.cc
r1543 r1629 78 78 if (this->bEvaluatedParams_ && this->function_) 79 79 { 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; 81 81 (*this->function_)(this->param_[0], this->param_[1], this->param_[2], this->param_[3], this->param_[4]); 82 82 return true; -
code/branches/input/src/core/ConsoleCommand.h
r1543 r1629 33 33 34 34 #include "Executor.h" 35 #include " ClassManager.h"35 #include "Identifier.h" 36 36 #include "CommandExecutor.h" 37 37 #include "ArgumentCompletionFunctions.h" -
code/branches/input/src/core/Executor.cc
r1505 r1629 30 30 #include "Executor.h" 31 31 #include "util/Math.h" 32 #include "util/Convert.h" 32 33 #include "Language.h" 33 34 … … 136 137 { 137 138 std::string paramnumber; 138 if (! Convert::ToString(¶mnumber, param))139 if (!convertValue(¶mnumber, param)) 139 140 return (*this); 140 141 -
code/branches/input/src/core/Iterator.h
r1543 r1629 92 92 { 93 93 this->element_ = element; 94 return *this; 94 95 } 95 96 -
code/branches/input/src/core/Loader.cc
r1505 r1629 116 116 Script::run();*/ 117 117 Script* lua = Script::getInstance(); 118 lua->clearLuaOutput(); 118 119 lua->loadFile(level->getFile(), true); 119 120 lua->run(); -
code/branches/input/src/core/Script.cc
r1505 r1629 39 39 } 40 40 41 #include "tolua ++.h"41 #include "tolua/tolua++.h" 42 42 #include "tolua/tolua_bind.h" 43 43 -
code/branches/input/src/core/Script.h
r1505 r1629 72 72 inline std::string getLuaOutput() { return output_; }; 73 73 //inline std::string* getFileString() { return &fileString_; }; 74 inline void clearLuaOutput() { output_ = ""; } 74 75 75 76 unsigned int getNextQuote(const std::string& text, unsigned int start); -
code/branches/input/src/core/TclThreadManager.h
r1535 r1629 45 45 namespace orxonox 46 46 { 47 class boost::thread;48 49 47 struct _CoreExport TclInterpreterBundle 50 48 { -
code/branches/input/src/core/XMLPort.h
r1505 r1629 152 152 this->parseResult_ = PR_waiting_for_default_values; 153 153 } 154 else 155 this->parseResult_ = PR_waiting_for_default_values; 154 156 } 155 157 catch (ticpp::Exception& ex) -
code/branches/input/src/core/input/InputInterfaces.h
r1535 r1629 37 37 #include "core/CorePrereqs.h" 38 38 39 #include "ois/OIS.h" 39 #include "src/ois/OISKeyboard.h" 40 #include "src/ois/OISMouse.h" 41 #include "src/ois/OISJoyStick.h" 40 42 #include "util/Math.h" 41 43 … … 47 49 enum Enum 48 50 { 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, 61 63 Minus = OIS::KC_MINUS, // - on main keyboard 62 Equals = OIS::KC_EQUALS, 64 Equals = OIS::KC_EQUALS, 63 65 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, 77 79 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, 90 92 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, 101 103 Period = OIS::KC_PERIOD, // . on main keyboard 102 104 Slash = OIS::KC_SLASH, // / on main keyboard 103 RightShift = OIS::KC_RSHIFT, 105 RightShift = OIS::KC_RSHIFT, 104 106 Multiply = OIS::KC_MULTIPLY, // * on numeric keypad 105 107 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, 119 121 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, 123 125 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, 127 129 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, 132 134 NumpadPeriod = OIS::KC_DECIMAL, // . on numeric keypad 133 135 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, 136 138 F13 = OIS::KC_F13, // (NEC PC98) 137 139 F14 = OIS::KC_F14, // (NEC PC98) … … 154 156 NextTrack = OIS::KC_NEXTTRACK, // Next Track 155 157 NumpadEnter = OIS::KC_NUMPADENTER, // Enter on numeric keypad 156 RightControl = OIS::KC_RCONTROL, 158 RightControl = OIS::KC_RCONTROL, 157 159 Mute = OIS::KC_MUTE, // Mute 158 160 Calculator = OIS::KC_CALCULATOR, // Calculator … … 164 166 NumpadComma = OIS::KC_NUMPADCOMMA, // , on numeric keypad (NEC PC98) 165 167 Divide = OIS::KC_DIVIDE, // / on numeric keypad 166 SYSRQ = OIS::KC_SYSRQ, 168 SYSRQ = OIS::KC_SYSRQ, 167 169 RightAlt = OIS::KC_RMENU, // right Alt 168 170 Pause = OIS::KC_PAUSE, // Pause … … 254 256 std::vector<Vector3> mVectors; 255 257 };*/ 256 258 257 259 /** 258 260 * Helper struct to determine which handlers of an object (can implement -
code/branches/input/src/core/input/InputManager.cc
r1537 r1629 36 36 37 37 #include <limits.h> 38 38 39 #include "core/CoreIncludes.h" 39 40 #include "core/ConfigValueIncludes.h" … … 42 43 #include "core/ConsoleCommand.h" 43 44 #include "core/Shell.h" // hack! 45 44 46 #include "InputBuffer.h" 45 47 #include "KeyBinder.h" 46 48 #include "KeyDetector.h" 47 49 #include "CalibratorCallback.h" 50 51 #include "src/ois/OISException.h" 52 #include "src/ois/OISInputManager.h" 48 53 49 54 namespace orxonox … … 650 655 activeHandlers_[iHandler].first->tickInput(dt, activeHandlers_[iHandler].second); 651 656 } 652 657 653 658 void InputManager::_completeCalibration() 654 659 { -
code/branches/input/src/core/input/InputManager.h
r1535 r1629 41 41 #include <vector> 42 42 43 #include "ois/OIS.h"44 43 #include "util/Math.h" 45 44 #include "core/OrxonoxClass.h" -
code/branches/input/src/core/input/KeyBinder.cc
r1543 r1629 234 234 void KeyBinder::setConfigValues() 235 235 { 236 SetConfigValueGeneric(KeyBinder, analogThreshold_, 0.0 1f) .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."); 237 237 SetConfigValueGeneric(KeyBinder, mouseSensitivity_, 1.0f) .description("Mouse sensitivity."); 238 238 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."); 240 240 SetConfigValueGeneric(KeyBinder, mouseSensitivityDerived_, 1.0f).description("Mouse sensitivity if mouse input is derived."); 241 241 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.