本文整理汇总了C++中GestureList::end方法的典型用法代码示例。如果您正苦于以下问题:C++ GestureList::end方法的具体用法?C++ GestureList::end怎么用?C++ GestureList::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GestureList
的用法示例。
在下文中一共展示了GestureList::end方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onFrame
void LeapInput::onFrame(const Controller& controller)
{
Frame frame = controller.frame();
HandList hands = frame.hands();
this->hands = hands.count();
if(hands.count() == 2)
{
Hand leftHand = hands.leftmost();
Hand rightHand = hands.rightmost();
leftHandY = leftHand.palmPosition().y;
rightHandY = rightHand.palmPosition().y;
leftFingers = leftHand.fingers().count();
rightFingers = rightHand.fingers().count();
float threshold = tanf(5* 3.141592f / 180.0f);
float maxTan = tanf(45 * 3.141592f / 180.0f);
if(leftHand.palmPosition().x != rightHand.palmPosition().x){
float tanValue = fabs((leftHand.palmPosition().y - rightHand.palmPosition().y) / (leftHand.palmPosition().x - rightHand.palmPosition().x));
if(tanValue > threshold){
curve = tanValue / maxTan;
if(curve > 1)
curve = 1;
}else
curve = 0;
}else
curve = 0;
}
else
{
leftHandY = rightHandY = 0;
}
boost = false;
GestureList gestureList = frame.gestures();
for(GestureList::const_iterator i = gestureList.begin(); i != gestureList.end(); ++i)
{
Gesture gesture = *i;
if(gesture.state() != Gesture::State::STATE_INVALID)
{
switch(gesture.type())
{
case Gesture::Type::TYPE_SCREEN_TAP:
boost = true;
break;
}
}
}
back = false;
if(hands.count() == 2 && leftFingers == 1 && rightFingers == 1 &&
hands.leftmost().fingers()[0].direction().z > 0 &&
hands.rightmost().fingers()[0].direction().z > 0)
{
back = true;
}
//accelGesture = brakeGesture = false;
//GestureList gestureList = frame.gestures();
//for(GestureList::const_iterator i = gestureList.begin(); i != gestureList.end(); ++i)
//{
// Gesture gesture = *i;
// if(gesture.state() != Gesture::State::STATE_INVALID)
// {
// if(typeid(gesture) == typeid(MyGesture))
// {
// accelGesture = true;
// }
//
// }
//}
}