![]() | |
![]() |
![]() |
![]() |
![]() |
overview |
Another skeleton class, mbnav is meant to handle all navigation details. Although defined in qcs, qcs::mbn_facing is the intended navigation direction, with qcs::mbn_velocity being the target speed.You can update qcs::mbn_facing without affecting qcs::mbf_facing. All updating should be done in mbnav::update().
NOTE THAT mbn_facing is defined in qcs so that update packets can be sent by qcs and not mbot
member variables |
class mbnav : public mbfire { protected: vector mbn_facing; float mbn_velocity; int mbn_jump; public: };
- mbn_facing
- This is the target direction for the navigation system to head in. Don't worry about affecting mbfire::mbf_facing
- mbn_velocity
- The target speed in the direction mbnav::mbn_facing to travel. Can be negative. Most servers set sv_maxspeed to 320.0
- mbn_jump
- If this is non-zero, mbot::sendMovement() does some voodoo to make the bot jump.
member functions |
class mbnav : public mbfire { protected: void jump(); public: mbnav(); ~mbnav(); void forceJump(); void update(); };
- jump
- Sets mbn_jump to 10, which sends the jump bit asserted for a few timestamps, then sets it unasserted for a few more.
- forceJump
- Calls mbnav::jump().
- update
- This is called after each server update (0.10 of a second). Note that mbnav is updated after mbfire