Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

PilotNode.cc

Go to the documentation of this file.
00001 #include "Motion/WalkMC.h"
00002 #ifdef TGT_HAS_WALK
00003 #include "Crew/Pilot.h"
00004 #endif
00005 
00006 #include "Events/PilotEvent.h"
00007 
00008 #include "PilotNode.h"
00009 
00010 void PilotNode::preStart() {
00011   StateNode::preStart();
00012   cancelFlag = false;
00013   const PilotRequest *p = tryExtractSignal<PilotRequest>(event);
00014   if ( p )
00015     pilotreq = *p;
00016 }
00017 
00018 void PilotNode::postStart() {
00019   StateNode::postStart();
00020   if ( !cancelFlag ) {
00021     erouter->addListener(this, EventBase::pilotEGID, (size_t)this, EventBase::statusETID);
00022 #ifdef TGT_HAS_WALK
00023     VRmixin::pilot->executeRequest(this,pilotreq);
00024 #endif
00025   }
00026 }
00027 
00028 void PilotNode::stop() {
00029 #ifdef TGT_HAS_WALK
00030   VRmixin::pilot->pilotPop();  // in case the request was still executing when we exited
00031 #endif
00032   StateNode::stop();
00033 }
00034 
00035 void PilotNode::doEvent() {
00036   postStateCompletion();
00037 }
00038 
00039 void PilotNode::cancelThisRequest() {
00040   cancelFlag = true;
00041   postStateFailure();
00042 }

DualCoding 5.1CVS
Generated Mon May 9 04:56:27 2016 by Doxygen 1.6.3