Leap Left Grab和 Event hand Grabbed
来源:互联网 发布:淘宝夏季新款女装 编辑:程序博客网 时间:2024/06/16 16:08
当前用UE4在做一个LeapMotion的交互功能,使用了插件包中的LeapMotionFloatingCharacter这个Character,在github中的插件使用文档中是这样的:
1,在这个项目中首先要实现LeapEventInterface接口;
2,添加LeapMotion的LeapController or (创建一个LeapController 类型的引用变量,然后在BeginPlay事件中添加AddController赋值给引用变量)
但是做完这些后,事件变成了多次执行,Leap Left Grab会重复执行(这个事件是重复执行的罪魁祸首)
实验了多次,才知道这和LeapController的添加有关,该Character的子物体组件LeapHands中的LeapAnimBodyConnectorActor中包含了一个LeapController,当执行Character中的
LeapMotion事件时,Leap Left Grab会重复调用事件,造成事件的重复。
解决办法有三种:
1,通过变量来控制事件中的蓝图函数执行次数,比如说:通过bool值来控制
2,通过叠加LeapController来达到单次执行的目的(每加一次LeapController,事件便多执行一次)
3,添加LeapController,并且只用Leap Interface Event;这样事件就不会造成重复执行;如果使用Leap Left Grab ,那么就会和整个Character中的LeapController添加相关,每添加一次,便会多执行一次,Leap Left Grab 本身上是一个Gamepad Events事件。所以两者事件不能混用,容易引发错误。在本例中,我把Leap Left Grab事件转化成了 Event hand Grabbed 和 Event hand Released 两个事件来执行,顺利的解决了问题。
- Leap Left Grab和 Event hand Grabbed
- Hand类(Leap::Hand)
- invalid assignment left-hand side
- AOJ 2132 Left Hand Rule
- offsetLeft与style.left的区别 event.altKey、event.ctrlKey、event.shiftKey 属性 clientWidth和offsetWidth
- ReferenceError: Invalid assignment left-hand side
- grab raw keyboard input from event device node
- Uncaught ReferenceError: Invalid left-hand side in assignment
- 118 js Uncaught ReferenceError: Invalid left-hand side in assignment
- 页面上报错:Invalid left-hand side in assignment
- ncaught ReferenceError: Invalid left-hand side expression in prefix operation
- Uncaught ReferenceError: Invalid left-hand side expression in postfix operation
- Uncaught ReferenceError: Invalid left-hand side in assignment
- 页面上报错:Invalid left-hand side in assignment
- VideoCapture之grab()和retrieve()
- hand
- event 和 window.event
- event 和 window.event
- 动态手势识别--训练模板方法(三)
- select详解
- Java编码规划最佳实践
- @Transactional的坑:耗时
- Android 点击屏幕其他位置隐藏Floating Action Button
- Leap Left Grab和 Event hand Grabbed
- Android四大组件之一的服务
- Quartz
- SQL基础
- mysql通过拷贝数据文件的方式进行数据库迁移
- 627. Swap Salary
- jquery多文件上传,获取每个文件大小
- vue 点击传参 页面跳转
- 逻辑设计中关于延时n拍的设计方法