Controller.cpp 808 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // Created by janco on 5/24/16.
  3. //
  4. #include "Controller.h"
  5. Controller::Controller(int controllerId) {
  6. this->controllerId = controllerId;
  7. this->ypr = Vec3f();
  8. this->joystick = Vec2f();
  9. this->setConnected(false);
  10. this->setConnected(true);
  11. }
  12. Controller::~Controller() { }
  13. void Controller::rumble(int duration, int power){
  14. // controllerhandler->rumble(controllerId, duration, power);
  15. }
  16. void Controller::setConnected(bool connected) {
  17. if(connected){
  18. this->connected = true;
  19. }else{
  20. this->connected = false;
  21. this->ypr = Vec3f(0,0,0);
  22. this->joystick = Vec2f(0,0);
  23. this->button = false;
  24. this->magnetSwitch = false;
  25. this ->joystickButton = false;
  26. }
  27. }
  28. bool Controller::isConnected(void) {
  29. return connected;
  30. }