[LeapMotion] InteractionEngine 示例模式由VR开发转为Desktop开发

本文介绍了如何将Unity3D中的LeapMotion InteractionEngine VR示例转换为适用于Desktop模式。主要涉及两步修改:将LeapXRServiceProvider替换为LeapServiceProvider以适应桌面开发,并调整Hand Models的Leap Provider设置。此外,还分享了一个小技巧,通过添加相机并修改Target Display为2,以及调整LeapRig位置,使得在Display2下双手能显示在合适位置。
摘要由CSDN通过智能技术生成

在Unity3D中导入Leap_Motion_Interaction_Engine_1.2.0包,在参考其示例Example时,可以增改两个小部分,将适应用VR开发的示例转为Desktop模式。

用Example 2举例,更改前

注意手的朝向

更改后:

 


示例的初始模式默认是采用VR模式,即开发时,LeapMotion需要放在脑门上,并且绿灯朝上,才能正常识别手势。

通过阅读帮助文档,修改以下部分,可以将LeapMotion正常放在桌面上进行识别。

<1>将LeapXRserviceProvider 改为LeapSer

https://github.com/leapmotion/UnityModules/releases/tag/Release-InteractionEngine-1.2.0 Interaction Engine 1.2.0 Changelog General Added the IgnoreCollidersForInteraction component, which causes a Collider to be ignored by the Interaction Engine. This is intended for trigger colliders that should be considered only for raycasting and not, e.g., for grasping or collision. Removed the (unused and deprecated) RigidbodyWarper script. VR controllers will now be detected at runtime in the IE example scenes that support them. (Previously, they had to be active and visible to Unity as soon as the application started running.) This functionality causes a minimal amount of garbage allocation every few seconds in those scenes, but did not have a noticeable impact on garbage collection times. You can disable this functionality by disabling "pollConnection" on the InteractionXRController script. Grasping Improved the ability to grasp small objects. Improved the consistency of grasping an object that was held by the other hand. Added OnGraspBegin, OnGraspStay, and OnGraspEnd callbacks to InteractionController. UI Modified the Basic UI example scene to demonstrate how a InteractionButton UI panel can be moved without causing the attached physical buttons to wobble. Curved Space Support Fixed a bug where Interaction Objects inherited LeapSpace components that were only used for an object's LeapGraphics. InteractionBehaviour now only considers any LeapSpaces -- such as LeapCylindricalSpace or LeapSphericalSpaces -- that are on or the parent of a Collider.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值