本文整理汇总了C++中TuioObject::getTuioPointer方法的典型用法代码示例。如果您正苦于以下问题:C++ TuioObject::getTuioPointer方法的具体用法?C++ TuioObject::getTuioPointer怎么用?C++ TuioObject::getTuioPointer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TuioObject
的用法示例。
在下文中一共展示了TuioObject::getTuioPointer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void Tuio2Simulator::mousePressed(float x, float y) {
//printf("pressed %f %f\n",x,y);
TuioPointer *match = NULL;
float distance = 0.01f;
for (std::list<TuioPointer*>::iterator iter = stickyPointerList.begin(); iter!=stickyPointerList.end(); iter++) {
TuioPointer *tptr = (*iter);
float test = tptr->getDistance(x,y);
if ((test < distance) && (test < 8.0f/width)) {
distance = test;
match = tptr;
}
}
Uint8 *keystate = SDL_GetKeyState(NULL);
if ((keystate[SDLK_LSHIFT]) || (keystate[SDLK_RSHIFT])) {
if (match!=NULL) {
std::list<TuioPointer*>::iterator joint = std::find( jointPointerList.begin(), jointPointerList.end(), match );
if( joint != jointPointerList.end() ) {
jointPointerList.erase( joint );
}
stickyPointerList.remove(match);
stickyPointerList.remove(match);
tuioServer->removeTuioPointer(match);
} else {
TuioObject *tobj = tuioServer->createTuioPointer(x,y,0,0,0,0);
stickyPointerList.push_back(tobj->getTuioPointer());
activePointerList.push_back(tobj->getTuioPointer());
}
} else if ((keystate[SDLK_LCTRL]) || (keystate[SDLK_RCTRL])) {
if (match!=NULL) {
std::list<TuioPointer*>::iterator joint = std::find( jointPointerList.begin(), jointPointerList.end(), match );
if( joint != jointPointerList.end() ) {
jointPointerList.remove( match );
} else jointPointerList.push_back(match);
}
} else {
if (match==NULL) {
TuioObject *tobj = tuioServer->createTuioPointer(x,y,0,0,0,0);
activePointerList.push_back(tobj->getTuioPointer());
} else {
activePointerList.push_back(match);
}
}
}