Changeset 10608 in orxonox.OLD for branches/scriptimprovements
- Timestamp:
- Mar 29, 2007, 5:50:50 PM (18 years ago)
- Location:
- branches/scriptimprovements/src/world_entities/script_triggers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/scriptimprovements/src/world_entities/script_triggers/script_trigger.h
r10607 r10608 41 41 void setAddToScript(const bool add) { this->addToScript = add; } 42 42 void setTriggerParent(const std::string& name); 43 44 inline void setScriptIsOk(bool ok){ scriptIsOk = ok ; } 45 inline void setScriptCalled(bool called){ scriptCalled = called; } 46 inline void setScriptFinished(bool finished){ scriptFinished = finished; } 47 48 ///POLLING 43 49 50 inline bool getScriptIsOk(){ return scriptIsOk; } 51 inline bool getScriptCalled(){ return scriptCalled; } 52 inline bool getScriptFinished(){ return scriptFinished; } 53 54 44 55 ///DRAWING 45 56 void draw()const{if(doDebugDraw)this->debugDraw();}; -
branches/scriptimprovements/src/world_entities/script_triggers/space_trigger.cc
r10607 r10608 116 116 void SpaceTrigger::tick(float timestep) 117 117 { 118 if( this->getScriptFinished() ) return; 118 119 120 if(triggerRemains && this->getScriptCalled() ) 121 { 122 executeAction(timestep); 123 return; 124 } 125 126 if( this->target != NULL) 127 { 128 if( !invert && this->distance(target) < radius) 129 { 130 //printf("Distance is %f \n", this->distance(target)); 131 executeAction(timestep); 132 this->setScriptCalled(true); 133 return; 134 135 } 136 else if( invert && this->distance(target) > radius) 137 { 138 executeAction(timestep); 139 this->setScriptCalled(true); 140 return; 141 } 142 } 119 143 } 120 144
Note: See TracChangeset
for help on using the changeset viewer.