Controls.pkg 721 B

123456789101112131415161718192021222324252627
  1. $#include "Controls.h"
  2. /// %Controls sent over the network.
  3. class Controls
  4. {
  5. public:
  6. /// Reset to initial state.
  7. void Reset();
  8. /// Set or release buttons.
  9. void Set(unsigned buttons, bool down = true);
  10. /// Check if a button is held down.
  11. bool IsDown(unsigned button) const;
  12. /// Check if a button was pressed on this frame. Requires previous frame's controls.
  13. bool IsPressed(unsigned button, const Controls& previousControls) const;
  14. /// Button state.
  15. unsigned buttons_ @ buttons;
  16. /// Mouse yaw.
  17. float yaw_ @ yaw;
  18. /// Mouse pitch.
  19. float pitch_ @ pitch;
  20. /// Extra control data.
  21. VariantMap extraData_ @ extraData;
  22. };