本文整理汇总了C++中ofxTuioCursor::getFingerId方法的典型用法代码示例。如果您正苦于以下问题:C++ ofxTuioCursor::getFingerId方法的具体用法?C++ ofxTuioCursor::getFingerId怎么用?C++ ofxTuioCursor::getFingerId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofxTuioCursor
的用法示例。
在下文中一共展示了ofxTuioCursor::getFingerId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tuioUpdated
//--------------------------------------------------------------
void gFrameApp::tuioUpdated(ofxTuioCursor &cursor)
{
if(input_tuio)
{
GPoint the_point;
float x,y;
x = cursor.getX();
y = cursor.getY();
the_point.setLocation(ofVec2f(x, y));
the_point.setId(cursor.getFingerId());
the_point.setStrokeId(cursor.getSessionId());
the_point.setColor(localBrushColor);
the_point.setType(TUIO);
the_point.setStyle(current_style);
stroke_list.add(the_point);
finger_positions[cursor.getFingerId()] = ofVec2f(x, y);
//flowfield
simple_flow.inputUpdate(x, y, cursor.getFingerId());
simple_flow_2.inputUpdate(x, y, cursor.getFingerId());
ledFrame.stopPulsing();
ledFrame.updateLastPointsTime();
}
}
示例2: 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
}
示例3: tuioRemoved
//--------------------------------------------------------------
void gFrameApp::tuioRemoved(ofxTuioCursor & cursor)
{
if(input_tuio)
{
finger_positions[cursor.getFingerId()] = ofVec2f(0, 0);
}
}
示例4: 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();
}
示例5: tuioAdded
void testApp::tuioAdded(ofxTuioCursor& tuioCursor)
{
log = " new cursor: ";
log += ofToString(tuioCursor.getFingerId());
log += " X: " + ofToString(tuioCursor.getX());
log += " Y: " + ofToString(tuioCursor.getY());
}
示例6: tuioUpdated
void testApp::tuioUpdated(ofxTuioCursor& tuioCursor)
{
log = " cursor updated: ";
log += ofToString(tuioCursor.getFingerId());
log += " X: " + ofToString(tuioCursor.getX());
log += " Y: " + ofToString(tuioCursor.getY());
}
示例7: 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
}
示例8: 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
}
示例9: 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);
}
}
}
示例10: 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();
}
示例11: 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();
}
}
示例12: cursorRemoved
// FINGER REMOVED //////////////////////////////////////////////////////
void testApp::cursorRemoved(ofxTuioCursor & tuioCursor)
{
int finger_id = tuioCursor.getFingerId();
pos.x = wQuadro * tuioCursor.getX();
pos.y = hQuadro * tuioCursor.getY();
list<Finger*>::iterator it;
for (it=dito_list.begin(); it !=dito_list.end(); ++it)
{
if ( (*it)->get_finger_id() == finger_id)
{
(*it)->removed();
break;
}
}
dito_list.erase(it);
}
示例13: cursorUpdated
// FINGER UPDATED //////////////////////////////////////////////////////
void testApp::cursorUpdated(ofxTuioCursor & tuioCursor)
{
int finger_id = tuioCursor.getFingerId();
pos.x = wFbo * tuioCursor.getX();
pos.y = hFbo * tuioCursor.getY();
int x_speed = tuioCursor.getXSpeed();
int y_speed = tuioCursor.getYSpeed();
int motion_speed = tuioCursor.getMotionSpeed();
int motion_accel = tuioCursor.getMotionAccel();
for (list<Finger*>::iterator it=dito_list.begin(); it !=dito_list.end(); ++it)
{
if ( (*it)->get_finger_id() == finger_id)
{
(*it)->update_interrupt(&pos);
break;
}
}
}
示例14: tuioAdded
//--------------------------------------------------------------
void ofApp::tuioAdded(ofxTuioCursor &cursor){
ofPoint loc = ofPoint(cursor.getX()*ofGetWidth(),cursor.getY()*ofGetHeight());
finger[cursor.getFingerId()].update(loc);
ledFrame.updateLastPointsTime();
}
示例15: tuioUpdated
void testApp::tuioUpdated(ofxTuioCursor & tuioCursor){
//カーソル状態更新
log = " cursor updated: " + ofToString(tuioCursor.getFingerId())+
" X: "+ofToString(tuioCursor.getX())+
" Y: "+ofToString(tuioCursor.getY());
}