本文整理汇总了C++中ofxTuioCursor类的典型用法代码示例。如果您正苦于以下问题:C++ ofxTuioCursor类的具体用法?C++ ofxTuioCursor怎么用?C++ ofxTuioCursor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ofxTuioCursor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: tuioRemoved
void ofxMtPhoto::tuioRemoved(ofxTuioCursor &tuioCursor){
ofVec2f loc = ofVec2f(tuioCursor.getX()*ofGetWidth(),tuioCursor.getY()*ofGetHeight());
for (int i = 0; i < cursorsOnBorder.size(); i++ )
if (cursorsOnBorder[i].idN == tuioCursor.getSessionId())
cursorsOnBorder.erase(cursorsOnBorder.begin()+i);
}
开发者ID:Diex,项目名称:MT_USB,代码行数:7,代码来源:ofxMtPhoto.cpp
示例2: tuioAdded
void testApp::tuioAdded(ofxTuioCursor& tuioCursor)
{
log = " new cursor: ";
log += ofToString(tuioCursor.getFingerId());
log += " X: " + ofToString(tuioCursor.getX());
log += " Y: " + ofToString(tuioCursor.getY());
}
开发者ID:meganeHunter,项目名称:myApps,代码行数:7,代码来源:testApp.cpp
示例3: tuioUpdated
void testApp::tuioUpdated(ofxTuioCursor& tuioCursor)
{
log = " cursor updated: ";
log += ofToString(tuioCursor.getFingerId());
log += " X: " + ofToString(tuioCursor.getX());
log += " Y: " + ofToString(tuioCursor.getY());
}
开发者ID:meganeHunter,项目名称:myApps,代码行数:7,代码来源:testApp.cpp
示例4: tuioUpdated
void FractalTreeApp::tuioUpdated(ofxTuioCursor &tuioCursor){
ofPoint addedCursor(tuioCursor.getX()*ofGetWidth(), tuioCursor.getY()*ofGetHeight());
addedCursor = toLocalAxisSystem(addedCursor);
IC = addedCursor;
}
开发者ID:push-pop,项目名称:ofxWindowedApp,代码行数:7,代码来源:fractalTree.cpp
示例5: tuioAdded
void ofApp::tuioAdded(ofxTuioCursor &tuioCursor)
{
tuioPoints.push_back(tuioContainer());
tuioPoints.back().sid = tuioCursor.getSessionId();
tuioPoints.back().location.set(tuioCursor.getX(), tuioCursor.getY());
tuioPoints.back().setLastLocation();
}
开发者ID:Echolaitoc,项目名称:PukTest,代码行数:7,代码来源:ofApp.cpp
示例6: tuioUpdated
//--------------------------------------------------------------
void ofApp::tuioUpdated(ofxTuioCursor &cursor){
Finger& f = finger[cursor.getFingerId()];
ofPoint loc = ofPoint(cursor.getX()*ofGetWidth(),cursor.getY()*ofGetHeight());
// save the active value because it will be overwritten after the update
bool wasActive = f.isActive();
f.update(loc);
// make a new ray if the speed is high enough, the finger was active and if the finger hasn't triggered anything lately
if(f.getDirection().length() > triggerSpeed && wasActive && f.getTimeSinceLastTriggered() > triggerTimeout){
f.triggered();
ParticleRay r = ParticleRay(f.getPosition(), f.getDirection().scale(particleSpeed));
// check if we need to create a new ray or if an old one can be reused
// this could very well be coded more efficiently...
int i = 0;
for(i = 0; i< rays.size(); i++){
if(rays[i].isDead()){
break;
}
}
if(i < rays.size()){
rays[i] = r;
} else{
rays.push_back(r);
}
}
// ledFrame.stopPulsing();
ledFrame.updateLastPointsTime();
}
开发者ID:TheConstitute,项目名称:Raybreak,代码行数:34,代码来源:ofApp.cpp
示例7: transf_PosTUIO
ofPoint menu::transf_PosTUIO(ofxTuioCursor & tuioCursor) {
int mx = W_WIDTH*tuioCursor.getX() + (ofGetScreenWidth()-W_WIDTH)/2.0;
int my = W_HEIGHT*tuioCursor.getY();
// ofPoint loc = ofPoint(mx,my);
return ofPoint(mx,my);
}
开发者ID:serman,项目名称:muncyt,代码行数:8,代码来源:menu_interaccion.cpp
示例8: tuioUpdated
void testApp::tuioUpdated(ofxTuioCursor & tuioCursor) {
//TODO add linemake function and update object
#ifdef DEBUG
log="Cursor Updated: "+ofToString(tuioCursor.getFingerId())+
" X: "+ofToString(tuioCursor.getX())+
" Y: "+ofToString(tuioCursor.getY());
ofLog()<<log;
#endif
}
开发者ID:mactkg,项目名称:ideatable,代码行数:9,代码来源:testApp.cpp
示例9: tuioAdded
//call when finger is moved
void testApp::tuioAdded(ofxTuioCursor & tuioCursor) {
//TODO add function that runs when finger added
#ifdef DEBUG
log="New Cursor: "+ofToString(tuioCursor.getFingerId())+
" X: "+ofToString(tuioCursor.getX())+
" Y: "+ofToString(tuioCursor.getY());
ofLog()<<log;
#endif
}
开发者ID:mactkg,项目名称:ideatable,代码行数:10,代码来源:testApp.cpp
示例10: tuioAdded
void FractalTreeApp::tuioAdded(ofxTuioCursor &tuioCursor){
//TODO: Check Menu Items
ofPoint addedCursor(tuioCursor.getX()*ofGetWidth(), tuioCursor.getY()*ofGetHeight());
addedCursor = toLocalAxisSystem(addedCursor);
}
开发者ID:push-pop,项目名称:ofxWindowedApp,代码行数:9,代码来源:fractalTree.cpp
示例11: tuioUpdated
void ofApp::tuioUpdated(ofxTuioCursor &tuioCursor)
{
// ofPoint loc = ofPoint(tuioCursor.getX()*ofGetWidth(),tuioCursor.getY()*ofGetHeight());
int cursorIndex = getTuioPointIndex(tuioCursor.getSessionId());
if (cursorIndex < 0)
{
return;
}
tuioPoints.at(cursorIndex).setLastLocation();
tuioPoints.at(cursorIndex).location.set(tuioCursor.getX(), tuioCursor.getY());
}
开发者ID:Echolaitoc,项目名称:PukTest,代码行数:11,代码来源:ofApp.cpp
示例12: tuioUpdated
void menu::tuioUpdated(ofxTuioCursor &tuioCursor){
// int mx = W_WIDTH*tuioCursor.getX();
//// int mx = W_WIDTH*(tuioCursor.getX()+0.5);
// int my = W_HEIGHT*tuioCursor.getY();
// ofPoint loc = ofPoint(mx,my);
ofPoint loc = transf_PosTUIO(tuioCursor);
// cout << "Point n" << tuioCursor.getSessionId() << " updated at " << loc << endl;
hands.notifySlide(loc.x, loc.y, tuioCursor.getSessionId(),tuioCursor.getMotionAccel());
// touchElements.notifySlide(loc.x, loc.y,tuioCursor.getSessionId(),tuioCursor.getMotionAccel());
}
开发者ID:serman,项目名称:muncyt,代码行数:12,代码来源:menu_interaccion.cpp
示例13: tuioRemoved
//call when finger is removed from Ideatable
void testApp::tuioRemoved(ofxTuioCursor & tuioCursor) {
//remove line which is related to the finger
for(line_itr=lines.begin(); line_itr!=lines.end(); line_itr++) {
if((*line_itr).getCursorID()==tuioCursor.getFingerId())
lines.erase(line_itr);
}
prevStatus.erase(tuioCursor.getFingerId());
#ifdef DEBUG
log="Cursor Removed: "+ofToString(tuioCursor.getFingerId())+
" X: "+ofToString(tuioCursor.getX())+
" Y: "+ofToString(tuioCursor.getY());
ofLog()<<log;
#endif
}
开发者ID:mactkg,项目名称:ideatable,代码行数:15,代码来源:testApp.cpp
示例14: tuioUpdated
void ofxLayout::tuioUpdated(ofxTuioCursor &tuioCursor)
{
if(tuioCursor.getFingerId() == 0){
if (touchReady){
ofPoint loc = ofPoint(tuioCursor.getX()*ofGetWidth(),tuioCursor.getY()*ofGetHeight());
mouseDraggedPt = ofPoint(loc)*mouseTransformation;
ofxLayoutElement* mouseDraggedElement = hittest(mouseDraggedPt);
mouseDraggedElement->fingerDragged(loc);
string evtStr = "mouseDragged";
ofNotifyEvent(mouseDraggedEvt, evtStr, mouseDraggedElement);
ofNotifyEvent(tuioCursorUpdatedEvt, tuioCursor, mouseDraggedElement);
}
}
}
开发者ID:local-projects,项目名称:ofxLayout,代码行数:14,代码来源:ofxLayout.cpp
示例15: tuioRemoved
void electromagnetica::tuioRemoved(ofxTuioCursor &tuioCursor){
ofPoint loc = ofPoint(tuioCursor.getX()*W_WIDTH,tuioCursor.getY()*W_HEIGHT);
//cout << "Point n" << tuioCursor.getSessionId() << " remove at " << loc << endl;
/*
if(id_slider1==tuioCursor.getSessionId()) id_slider1=NULL;
if(id_jumpingRect==tuioCursor.getSessionId()) id_jumpingRect=NULL;
if(id_moverect==tuioCursor.getSessionId()) id_moverect=NULL;*/
hands.removeObjectByTuioID(tuioCursor.getSessionId() );
wavesm.touchUp(tuioCursor.getSessionId());
cheapComm::getInstance()->sendAudio0("/audio/electromagnetism/hand_off_event");
}
开发者ID:serman,项目名称:muncyt,代码行数:14,代码来源:electromagnetica.cpp
示例16: cursorAdded
// FINGER ADDED ////////////////////////////////////////////////////////
void testApp::cursorAdded(ofxTuioCursor & tuioCursor)
{
int finger_id = tuioCursor.getFingerId();
pos.x = wQuadro * tuioCursor.getX();
pos.y = hQuadro * tuioCursor.getY();
dito = new Finger(finger_id);
dito_list.push_back(dito);
dito_list.back()->setup(&pos, blue);
dito_list.back()->added();
}
开发者ID:Limulo,项目名称:prototipo3,代码行数:16,代码来源:TestApp.cpp
示例17: tuioRemoved
void testApp::tuioRemoved(ofxTuioCursor &tuioCursor){
ofLog()<< "tuioRemoved" << endl;
ofPoint loc = ofPoint(tuioCursor.getX()*W_WIDTH,tuioCursor.getY()*W_HEIGHT);
//cout << "Point n" << tuioCursor.getSessionId() << " remove at " << loc << endl;
/*
if(id_slider1==tuioCursor.getSessionId()) id_slider1=NULL;
if(id_jumpingRect==tuioCursor.getSessionId()) id_jumpingRect=NULL;
if(id_moverect==tuioCursor.getSessionId()) id_moverect=NULL;*/
touchElements.removeObjectByTuioID(tuioCursor.getSessionId() );
touchElements.notifyTouchUp( tuioCursor.getSessionId() );
}
开发者ID:serman,项目名称:muncyt_tests,代码行数:15,代码来源:testApp.cpp
示例18: tuioAdded
void testApp::tuioAdded(ofxTuioCursor &tuioCursor){
ofLog()<< "tuioAdded" << endl;
ofPoint loc = ofPoint(tuioCursor.getX()*W_WIDTH,tuioCursor.getY()*W_HEIGHT);
cout << "Point n" << tuioCursor.getSessionId() << " add at " << tuioCursor.getX() << " " << tuioCursor.getY()<< endl;
// o1.touch(loc.x, loc.y,tuioCursor.getSessionId());
// h1.touch(loc.x, loc.y,tuioCursor.getSessionId());
handShadow *h1 = new handShadow();
h1->setup();
touchElements.addObject(*h1);
touchElements.notifyTouch(loc.x, loc.y,tuioCursor.getSessionId());
}
开发者ID:serman,项目名称:muncyt_tests,代码行数:15,代码来源:testApp.cpp
示例19: tuioRemoved
void ofxLayout::tuioRemoved(ofxTuioCursor &tuioCursor)
{
if(tuioCursor.getFingerId() == 0)
{
ofPoint loc = ofPoint(tuioCursor.getX()*ofGetWidth(),tuioCursor.getY()*ofGetHeight());
mouseDraggedPt.set(ofPoint());
mouseReleasedPt = loc*mouseTransformation;
ofxLayoutElement* mouseReleasedElement = hittest(mouseReleasedPt);
mouseReleasedElement->fingerReleased(loc);
string evtStr = "mouseReleased";
ofNotifyEvent(mouseReleasedEvt, evtStr, mouseReleasedElement);
ofNotifyEvent(tuioCursorRemovedEvt, tuioCursor, mouseReleasedElement);
touchReadyCheck();
}
}
开发者ID:local-projects,项目名称:ofxLayout,代码行数:16,代码来源:ofxLayout.cpp
示例20: tuioRemoved
//--------------------------------------------------------------
void gFrameApp::tuioRemoved(ofxTuioCursor & cursor)
{
if(input_tuio)
{
finger_positions[cursor.getFingerId()] = ofVec2f(0, 0);
}
}
开发者ID:der-rob,项目名称:gFrame,代码行数:8,代码来源:gFrameApp.cpp
注:本文中的ofxTuioCursor类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论