本文整理汇总了Java中com.thalmic.myo.Pose.WAVE_OUT属性的典型用法代码示例。如果您正苦于以下问题:Java Pose.WAVE_OUT属性的具体用法?Java Pose.WAVE_OUT怎么用?Java Pose.WAVE_OUT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.thalmic.myo.Pose
的用法示例。
在下文中一共展示了Pose.WAVE_OUT属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPose
@Override
public void onPose(Myo myo, long timestamp, Pose pose) {
if(!myo.isUnlocked() && pose != Pose.DOUBLE_TAP) { return; }
// Swap wave poses if the Myo is on the left arm. Allows user to "wave" right or left
// regardless of the Myo arm and have the swipes be in the appropriate direction.
if (mArm == Arm.LEFT) {
if (pose == Pose.WAVE_IN) {
pose = Pose.WAVE_OUT;
} else if (pose == Pose.WAVE_OUT) {
pose = Pose.WAVE_IN;
}
}
// Dispatch touch pad events for the standard navigation controls based on the
// current pose.
switch (pose) {
case DOUBLE_TAP:
if(myo.isUnlocked()) {
lock(myo);
} else {
unlock(myo);
}
break;
case FIST:
mStartingRoll = mCurrentRoll;
break;
case FINGERS_SPREAD:
if(mPanningEnabled) {
stopPanning(myo);
} else {
startPanning(myo);
}
break;
case WAVE_IN:
if(!mZoomingEnabled) {
startZooming(mZoomoutFactor);
}
break;
case WAVE_OUT:
if(!mZoomingEnabled) {
startZooming(mZoominFactor);
}
break;
case REST:
switch(mCurrentPose) {
case WAVE_IN:
case WAVE_OUT:
stopZooming();
break;
}
break;
}
mCurrentPose = pose;
}
示例2: onPose
@Override
public void onPose(Myo myo, long timestamp, Pose pose) {
if(!myo.isUnlocked() && pose != Pose.DOUBLE_TAP) { return; }
// Swap wave poses if the Myo is on the left arm. Allows user to "wave" right or left
// regardless of the Myo arm and have the swipes be in the appropriate direction.
if (mArm == Arm.LEFT) {
if (pose == Pose.WAVE_IN) {
pose = Pose.WAVE_OUT;
} else if (pose == Pose.WAVE_OUT) {
pose = Pose.WAVE_IN;
}
}
// Dispatch events for the standard navigation controls based on the
// current pose.
switch (pose) {
case DOUBLE_TAP:
if(myo.isUnlocked()) {
lock(myo);
} else {
unlock(myo);
}
break;
case FIST:
mStartingRoll = mCurrentRoll;
break;
case FINGERS_SPREAD:
if(mPanningEnabled) {
stopPanning(myo);
} else {
startPanning(myo);
}
break;
case WAVE_IN:
mMapView.zoomout();
// This is the code that was demo'd at the Developer Summit. I had to modify
// the accessor of the doubleTapZoom method (something we introduced for smaller
// screened devices, allowing you to double-tap-then-drag to zoom) to be public.
// The above code will require the pose to be repeated every time you want to zoom
// out/in, which feels a little worse on your wrist.
// if(!mZoomingEnabled) {
// startZooming(ZOOMOUT_FACTOR);
// }
break;
case WAVE_OUT:
mMapView.zoomin();
// if(!mZoomingEnabled) {
// startZooming(ZOOMIN_FACTOR);
// }
break;
case REST:
// if(mZoomingEnabled) {
// stopZooming();
// }
break;
}
mCurrentPose = pose;
}