Changeset 10634 in orxonox.OLD for branches/inputdevice/src/world_entities/script_triggers
- Timestamp:
- Apr 19, 2007, 11:45:56 AM (18 years ago)
- Location:
- branches/inputdevice/src/world_entities/script_triggers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/inputdevice/src/world_entities/script_triggers/action_trigger.cc
r10632 r10634 17 17 #include "action_trigger.h" 18 18 #include "debug.h" 19 #include "event_handler.h" 19 20 20 21 ObjectListDefinition(ActionTrigger); … … 48 49 { 49 50 this->registerObject(this, ActionTrigger::_objectList); 51 this->subscribeEvent(ES_GAME, KeyMapper::PEV_ACTION); 50 52 51 53 radius = 10; … … 117 119 } 118 120 121 void ActionTrigger::process( const Event &event) 122 { 123 if (event.type == KeyMapper::PEV_ACTION && event.bPressed) 124 actionScheduled = true; 125 } 119 126 120 127 void ActionTrigger::tick( float timestep ) … … 128 135 executeScriptFunction(timestep); 129 136 scriptCalled = true; 130 return;131 137 } 132 138 else if( invert && this->distance(target) > radius && actionScheduled) … … 134 140 executeScriptFunction(timestep); 135 141 scriptCalled = true; 136 return;137 142 } 138 143 } -
branches/inputdevice/src/world_entities/script_triggers/action_trigger.h
r10631 r10634 12 12 #include "script_class.h" 13 13 #include "script_trigger.h" 14 #include "event_listener.h" 14 15 15 class ActionTrigger : public ScriptTrigger 16 class ActionTrigger : public ScriptTrigger, public EventListener 16 17 { 17 18 ObjectListDeclaration(ActionTrigger); … … 26 27 27 28 /// DO WORK 28 virtual void executeAction(){actionScheduled = true;}29 virtual void process( const Event &event); 29 30 virtual void tick(float timestep); 30 31 -
branches/inputdevice/src/world_entities/script_triggers/script_trigger.h
r10631 r10634 29 29 virtual void tick(float timestep){} 30 30 virtual void executeScriptFunction(float timestep); 31 void testScriptingFramework();32 31 33 32 /// SET MEMBER
Note: See TracChangeset
for help on using the changeset viewer.