- Timestamp:
- May 21, 2014, 2:32:41 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ScriptableController/src/orxonox/controllers/ScriptController.h
r10059 r10065 42 42 { 43 43 std::string fctName; 44 float xCoord; 45 float yCoord; 46 float zCoord; 44 float x1; 45 float y1; 46 float z1; 47 48 float x2; 49 float y2; 50 float z2; 51 52 float duration; 47 53 48 54 float eventTime; … … 54 60 { // tolua_export 55 61 public: 56 //ScriptController(Context* context, ControllableEntity* CE);57 62 ScriptController(Context* context); 58 63 59 64 virtual ~ScriptController() { } 60 65 61 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);66 //virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 62 67 63 68 void takeControl(int ctrlid); 64 69 void setPlayer(PlayerInfo* player) { this->player_ = player; } 65 70 66 67 68 //void set_luasrc(std::string);69 //void set_controlled(ControllableEntity*);70 71 71 virtual void tick(float dt); 72 72 73 73 // LUA interface 74 74 // tolua_begin 75 void moveToPosition_beta(float x, float y, float z); 75 void moveAndLook(float xm, float ym, float zm, 76 float xl, float yl, float zl, float t); 76 77 77 void eventScheduler(std::string instruction, float x, float y, float z, float time); 78 void eventScheduler(std::string instruction, 79 float x1, float y1, float z1, 80 float x2, float y2, float z2, 81 float duration, float executionTime); 78 82 79 83 static ScriptController* getScriptController(); 80 84 81 85 int getID() { return ctrlid_; } 82 83 86 84 87 // tolua_end … … 88 91 89 92 private: 90 // name of the LUA-sourcefile that shall be executed->see XMLPort-function 91 std::string luasrc; 93 /* Information about the player that this ScriptController will 94 * control */ 95 /* - Player pointer */ 92 96 PlayerInfo* player_; 97 98 /* - Entity pointer, this is for convenience and will be the same as 99 * player_->getControllableEntity() 100 */ 93 101 ControllableEntity* entity_; 102 103 /* Controller ID, defaults to 0 and is set using takeControl() */ 94 104 int ctrlid_; 95 105 106 /* List of events to walk through */ 107 std::vector<event> eventList; 108 unsigned int eventno; 109 110 /* Time since the creation of this ScriptController object */ 111 float scTime; 112 113 /* Boolean that specifies whether we're processing an event right 114 * now */ 115 bool processing; 116 117 /* Data about the point to go to and what to look at */ 118 /* - Target position */ 119 Vector3 target; 120 121 /* - Time it should take to get there */ 122 float timeToTarget; 123 124 /* - Time this event has been going on for */ 125 float eventTime; 126 Vector3 startpos; 127 128 /* - Position to look at during that transition */ 129 Vector3 lookAtPosition; 96 130 97 131 };// tolua_export
Note: See TracChangeset
for help on using the changeset viewer.