![]() | |
![]() |
![]() |
![]() |
![]() |
overview |
One of the skeleton classes, mbfire provides little functionality. There are some pre-defined functions and variables (mbfire::update(), qcs::mbf_facing) which provide enough information to mbot to send update packets with seperated navigation and firing facings.It it important to note that you can make the mbf_facing anything you want without affecting the similar qcs::mbn_facing in mbnav
NOTE THAT mbf_facing is defined in qcs so that update packets can be sent by qcs and not mbot
member variables |
class mbfire : public mbtalk { protected: int mbf_shoot; int mbf_impulse; vector mbf_facing; public: };
mbf_shoot If this is 2, firing is inactive. 1 means assert the fire bit, 0 means send 0 in the fire bit.
mbf_impulse If this is non-zero, that impulse is sent and mbf_impulse is set to 0.
mbf_facing Where firecontrol should face. mbnav's mbn_facing is completely independent of this.
member functions |
class mbfire : public mbtalk { protected: void fire(); public: mbfire(); ~mbfire(); void update(); void forceShoot(); void sendImpulse( int x ); };
- fire
- Makes mbf_shoot 1, causing the bot to shoot.
- update
- Called on each timestamp (after getting a server update, every 0.10 of a second, by default) mbfire is updated before mbnav
- forceShoot
- Allows the operator to force the bot to shoot. Just calls mbfire::fire().
- sendImpulse
- Sends the specified impulse. Valid numbers are 0 .. 255