1,Bone下left()函数可以用来判定当前是哪一个手掌在进行控制,通过left来过滤左手和右手的消息
2,Pointable:
touchZone:返回字符串(String)“touching”“hovering”用来判定触碰点击事件可以混用缩小事件范围
tipVelocity : 顶端位置变化的速率mm/s 通过该属性来分离快慢动作,是一个不错的选择
3,Hand:
pinchStrength:捏的力度【0-1】
grabStrength:抓的力度【0-1】用来判定抓捏力度来进行一些握拳,抓取动作
palmVelocity 改变手掌位置的速度改变手掌位置的速度
valid:是否有效
4,Frame:
gestures:保存手势信息
pointable(id):valid 匹配对应的ID是否存在
5,controller:
onBlur:失去焦点时触发的事件
on:触发事件
6,Gesture:
duration:持续事件,微秒级
type:circle,swipe,screenTap,keyTap
CircleGesture:progress(画圆的次数)
SwipeGesture:speed(速度),position(当前位置),startPosition(开始位置)
KeyTapGesture:duration(持续时间),state(状态),type(类型)
exmple:
//当前hand Mesh
if(frame.hands.length==1)
{
var handTemp = frame.hands[0];
var boneTemp =handTemp.arm;
if(boneTemp.left())
{
TODO somethings
//左手事件处理
}
if(!boneTemp.left())
{
//右手事件处理
}
}
if(frame.hands.length==
Leap Motion(JS)控制(提高事件判定精准度)
最新推荐文章于 2025-01-10 09:54:12 发布