Browse Source

Update example_gamepad with ofx::piMapper::Vec3

master
Krisjanis Rijnieks 8 years ago
parent
commit
e4fb63c38f
  1. 8
      example_gamepad/src/ofApp.cpp
  2. 3
      example_gamepad/src/ofApp.h

8
example_gamepad/src/ofApp.cpp

@ -49,13 +49,13 @@ void ofApp::messageReceived(ofMessage & message){
*/
void ofApp::handleController(ControllerCommand com){
if(com == ControllerCommand::COMMAND_LEFT){
mapper.moveSelection(ofVec2f(-5.0f, 0.0f));
mapper.moveSelection(ofx::piMapper::Vec3(-5.0f, 0.0f, 0.0f));
}else if(com == ControllerCommand::COMMAND_RIGHT){
mapper.moveSelection(ofVec2f(5.0f, 0.0f));
mapper.moveSelection(ofx::piMapper::Vec3(5.0f, 0.0f, 0.0f));
}else if(com == ControllerCommand::COMMAND_UP){
mapper.moveSelection(ofVec2f(0.0f, -5.0f));
mapper.moveSelection(ofx::piMapper::Vec3(0.0f, -5.0f, 0.0f));
}else if(com == ControllerCommand::COMMAND_DOWN){
mapper.moveSelection(ofVec2f(0.0f, 5.0f));
mapper.moveSelection(ofx::piMapper::Vec3(0.0f, 5.0f, 0.0f));
}else if(com == ControllerCommand::COMMAND_A){
if(mapper.getMode() == ofx::piMapper::Mode::MAPPING_MODE){
mapper.selectNextVertex();

3
example_gamepad/src/ofApp.h

@ -3,6 +3,7 @@
#include "ofMain.h"
#include "ofxPiMapper.h"
#include "InputHandler.h"
#include "Vec3.h"
class ofApp : public ofBaseApp {
public:
@ -22,4 +23,4 @@ class ofApp : public ofBaseApp {
void handleController(ControllerCommand com);
ofxPiMapper mapper;
};
};

Loading…
Cancel
Save