Controller.cpp 777 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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(true);
  10. }
  11. Controller::~Controller() { }
  12. void Controller::rumble(int duration, int power){
  13. // controllerhandler->rumble(controllerId, duration, power);
  14. }
  15. void Controller::setConnected(bool connected) {
  16. if(connected){
  17. this->connected = true;
  18. }else{
  19. this->connected = false;
  20. this->ypr = Vec3f(0,0,0);
  21. this->joystick = Vec2f(0,0);
  22. this->button = false;
  23. this->magnetSwitch = false;
  24. this ->joystickButton = false;
  25. }
  26. }
  27. bool Controller::isConnected(void) {
  28. return connected;
  29. }