【VR】Leap Motion 官网文档 HandController(手部控制器)

前言:

本系列译文是为迎合Unity VR的热潮与大家的学习需要,推出的针对Unity方向的Leap Motion官方文档中英对照翻译。 本篇第五篇
《HandController(手部控制器)》 介绍了HandController(手部控制器)预设体与HandController脚本组件使用,以及HandController类中定义的各个公共属性与方法。

HandController  手部控制器

The HandController script is attached to the HandController prefab. The prefab serves as the anchor point for drawing hands. You can set the HandController properties, such as which hand prefabs to use, in the Inspector panel.

HandController脚本组件添加在HandController(手部控制器)预设体上。该预设体是用来绘制手型的锚点。你可以在检视面板中设置HandController的属性,例如使用哪种手型预设体等。

When you play the scene, any hands detected by the Leap Motion controller are drawn relative to the position and orientation of the prefab.

当你运行场景之后,Leap Motion 控制器检测到的所有手型都将相对于该预设体的位置和方向进行绘制。

If your hand is 20cm above the Leap Motion device, the virtual hand is drawn 20cm above the prefab position (if the HandController transform scale is set to 1.0). Do note that the default scale is 20:1, so hands are drawn much larger than real-size. In the
Unity Scene view, the approximate field of view of the Leap Motion sensors are shown.

如果手在Leap Motion设备上方20厘米,虚拟手讲被绘制在预设体上方20厘米(前提是HandController对象的Transfom组件的scale值为1)。需要注意的是,默认情况下缩放比例为20:1,因而场景中绘制出来的手型要比实际大得多。在Unity场景视图中我们可以看到Leap Motion传感器的近似视野区域。

class HandController   HandController 类

The Controller object that instantiates hands and tools to represent the hands and tools tracked by the Leap Motion device.

该控制器对象用于实例化Leap Motion设备追踪的手部和工具。

HandController is a Unity MonoBehavior instance that serves as the interface
between your Unity application and the Leap Motion service.

HandController类是Unity MonoBehavior类的子类,是Unity应用程序和Leap Motion服务的接口。

The HandController script is attached to the HandController prefab.
Drop a HandController prefab into a scene to add 3D, motion-controlled hands.
The hands are placed above the prefab at their real-world relationship to the physical Leap device. You can change the transform of the prefab to adjust the orientation and the size of the hands in the scene. You can change the HandController.handMovementScale property
to change the range of motion of the hands without changing the apparent model size.

HandController脚本添加在HandController预设体上。将HandController预设体拖拽到场景中可以添加3D的动作控制手型。手型会根据真实世界的物理Leap设备感知出现在预设体上方。你可以通过改变该预设体Transform组件的属性值来调整场景中手型的方向和大小。改变HandController.handMovementScale属性可以在不改变手型大小的前提下改变手部运动的范围。

When the HandController is active in a scene, it adds the specified 3D
models for the hands to the scene whenever physical hands are tracked by the Leap Motion hardware. By default, these objects are destroyed when the physical hands are lost and recreated when tracking resumes. The asset package provides a variety of hands that
you can use in conjunction with the hand controller.

若手部控制器在场景中处于激活状态,就会在Leap Motion硬件设备追踪到手部时,在场景中添加指定的3D手型。默认情况下,这些对象会在追踪不到时销毁,再次追踪到时重新创建。资源包提供了多种手型,与手部控制器结合使用。

Public Functions  公共函数

void DestroyAllHands()  销毁所有手型

Destroys all hands owned by this HandController instance.

销毁当前HandController类实例化的所有手型。

string FinishAndSaveRecording()  完成并保存记录

Saves the current recording to a new file, returns the path, and starts playback.

保存当前记录到一个新的文件中,返回路径,并播放

Return  返回值
string The path to the saved recording.   字符串类型  记录所保存的路径。

HandModel [] GetAllGraphicsHands()  获取所有图形手型

Returns a copy of the hand model list.  返回手部模型列表的拷贝

HandModel [] GetAllPhysicsHands() 获取所有物理手型

Returns a copy of the physics model list.  返回物理模型列表的拷贝

Frame GetFrame()  获取帧

Returns the latest frame object.  返回对象的最后一帧。

If the recorder object is playing a recording, then the frame is taken from the recording. Otherwise, the frame comes from the Leap Motion Controller itself.

如果记录器对象正在播放记录,那么该帧将从记录中获取。否则将从Leap Motion控制器本身获取。

Controller GetLeapController() 获取Leap控制器

Returns the Leap Controller instance. 返回Leap控制器实例。

float GetRecordingProgress() 获取记录进度

The current frame position divided by the total number of frames in the recording.

记录当前帧的进度比例。[译者注:取值范围为 0 ~ 1]

void IgnoreCollisionsWithHands(GameObject to_ignore, bool ignore = true) 忽略手部碰撞

Turns off collisions between the specified GameObject and all hands.

关闭指定游戏对象与手部的碰撞。

Subject to the limitations of Unity Physics.IgnoreCollisions(). See .

参见Unity Physics.IgnoreCollisions()。

bool IsConnected() 是否连接

True, if the Leap Motion hardware is plugged in and this application is connected to the Leap Motion service.

返回值为真,表示Leap Motion硬件已插入,且当前应用程序连接到Leap Motion服务。

bool IsEmbedded() 是否嵌入

True, if the active Leap Motion device is embedded in a laptop or keyboard.

返回值为真,表示当前启用的Leap Motion设备嵌入在笔记本电脑或键盘中。

void PauseRecording() 暂停记录

Stops playback or recording without resetting the frame counter.

暂停播放或记录。

void PlayRecording() 播放记录

Start getting frames from the LeapRecorder object rather than the Leap service.

从LeapRecorder对象中获取帧,而非Leap服务。

void Record() 录制

Starts saving frames.

开始保存帧。

void ResetRecording() 重设记录

Discards any frames recorded so far.

舍弃之前已录制的帧。

void StopRecording() 停止记录

Stops recording or playback and resets the frame counter to the beginning.

停止录制或播放,并将当前帧设置到初始位置。

Public Members  公共成员

bool destroyHands  是否可以手动销毁手型

If hands are in charge of Destroying themselves, make this false.

如果手型自主销毁,需要将其设置为false。

bool enableRecordPlayback 记录播放有效化

Set true to enable recording.

设置为true 使记录播放有效。

Vector3 handMovementScale 手部移动范围

The scale factors for hand movement.

手部移动的缩放比例。

Set greater than 1 to give the hands a greater range of motion.

该值大于1时将放大手部移动范围。

bool isHeadMounted 是否用于头戴设备

Set true if the Leap Motion hardware is mounted on an HMD; otherwise, leave false.

当Leap Motion硬件被用于头戴设备时,设置为true;否则为false。

HandModel leftGraphicsModel
左侧图形模型

The GameObject containing graphics to use for the left hand or both hands if separateLeftRight is false.

左手所使用的图形对象,当separateLeftRight为false时用于双手。

HandModel leftPhysicsModel
左侧物理模型

The GameObject containing colliders to use for the left hand or both hands if separateLeftRight is false.

左手所使用的物理碰撞器对象,当separateLeftRight为false时用于双手。

bool mirrorZAxis 镜像Z轴

Reverses the z axis.

对Z轴方向取反。

bool recorderLoop 记录器循环

Whether to loop the playback.

控制是否循环播放。

float recorderSpeed 记录器速度

Playback speed. 播放速度。

Set to 1.0 for normal speed.  1为正常速度。

TextAsset recordingAsset 记录文件资源

The file to record or playback from.

记录或播放的文件。

HandModel rightGraphicsModel
侧图形模型

The graphics hand model to use for the right hand.

右手使用的图形手型。

HandModel rightPhysicsModel
右侧物理模型

The physics hand model to use for the right hand.

右手使用物理手型。

bool separateLeftRight 分离左右手

Whether to use a separate model for left and right hands (true); or mirror the same model for both hands (false).

用于控制左右手使用不同模型(为true时)或通过镜像使用相同模型(为false时)。

ToolModel toolModel
工具模型

The GameObject containing both graphics and colliders for tools.

改游戏对象包含工具的图形和碰撞器。

————————————————————————————————

更多参考:

【VR】Leap Motion 官网文档 脚本参考(目录)

(版权声明:本篇为Leap Motion 官网文档译文,版权归Leap Motion 官网所有,图文内容仅供学习使用。)

时间: 2024-08-05 15:32:34

【VR】Leap Motion 官网文档 HandController(手部控制器)的相关文章

【VR】Leap Motion 官网文档 HandModel(手部模型)

前言: 本系列译文是为迎合Unity VR的热潮与大家的学习需要,推出的针对Unity方向的Leap Motion官方文档中英对照翻译. 本篇为第六篇 <HandModel(手部模型)> ,该类主要用于连接控制器和手部模型,以及处理手臂.肘部.手掌.手指的位置和角度等信息. Handmodel is the base class for all the other hand scripts. If you are creating your own hands and need a custo

【VR】Leap Motion 官网文档 脚本参考(目录)

前言: 本系列译文是为迎合Unity VR的热潮与大家的学习需要,推出的针对Unity方向的Leap Motion官方文档中英对照翻译. 本篇第四篇 <脚本参考> 以目录链接的形式列出了Leap Motion为Unity提供的核心资源包中所包含的脚本定义的类. 关于每个类的详细内容后续献上,敬请期待. 英文原文网址:https://developer.leapmotion.com/documentation/unity/unity/Unity_Classes.html 译文首发&持续更

【VR】Leap Motion 官网文档 FingerModel (手指模型)

前言: 感谢关注和支持这个Leap Motion系列翻译的朋友们,很抱歉由于工作原因很久没有更新,今后这个翻译还会继续(除非官方直接给出中文文档).本篇献给大家的是 <FingerModel (手指模型)> ,该类主要用于手指模型的创建.更新.信息获取及控制等. FingerModel?  手指模型类 FingerModel is the base class for all the other finger scripts. If you are creating your own fing

【VR】Leap Motion 官网文档 ToolModel (工具模型)

前言 非常开心的是,Leap Motion官方文档的翻译工作有了新的伙伴加入,特此转发过来. 原译文链接:http://blog.csdn.net/qq_18408937/article/details/47373879 ToolModel  工具模型 ToolModel updates a model's position and orientation based on a tracked tool. Compared to hands, tools are very simple and

【VR】Leap Motion 官网文档 ConfidenceTransparency (确定性透明处理)

前言 由于新搭档的加入,翻译的工作进展快了许多. 本篇是Unity引擎中Leap Motion工具模型类中关于透明处理的类,希望对大家有帮助. 原译文链接:http://blog.csdn.net/qq_18408937/article/details/47382423 ConfidenceTransparency   确定性透明处理 Sets a hand's opacity based on its current confidence rating. 基于手部的当前确定性来设置它的透明度.

【VR】Leap Motion 官网文档 MagneticPinch (磁性捏取)

前言 至此LeapMotion的Unity主体部分的翻译全部结束,同时本篇也是搭档的第十篇博客. 为了纪念这里程碑式的时刻,现将微信二维码头像换成合照 *^-^* 原译文链接:http://blog.csdn.net/qq_18408937/article/details/47452343 磁性捏取类是为了应对体感输入的一种有效方式,为了增强用户体验,让操作更容易比让操作更拟真往往更重要. MagneticPinch 磁性捏取 Attach this script to a RigidHand

【VR】Leap Motion 官网文档 Unity插件概述

前言: Leap Motion的官网文档已经有不少的热心网友参与了翻译,但没有覆盖官网文档的全部. 为迎合Unity VR的热潮与大家的学习需要,本博客将推出针对Unity方向的官方文档翻译系列. 本篇主要对Leap Motion的Unity插件及坐标系系统进行简述. 英文原文网址:https://developer.leapmotion.com/documentation/unity/unity/Unity_Overview.html 译文首发&持续更新:http://blog.csdn.ne

【VR】Leap Motion 官网文档 DisconnectionNotice (未连接通知)

前言 不能不说~  新搭档真心给力!翻译的节奏很嗨.这两篇本人也简单参与了审校,姑且算是合作的吧. VR热逐渐趋于理智,但软件对VR硬设的探索和发挥依然停留在初始阶段.相对而言,一些VR硬设文档缺乏中文文档,为广大开发者的学习带来阻碍和不便.本系列译文就是在这样的背景下诞生的,而首先推出的是价位上人手可及的 Leap Motion系列. Leap Motion 的 DisconnectionNotice类会在没有连接时以视觉形式反馈给用户,以便让重新连接. 原译文链接:http://blog.c

【VR】Leap Motion 官网文档 LeapUnityExtensions (LeapUnity扩展)

前言 Leap Motion Unity部分的API进入最后冲刺阶段,不算派生的小类,本篇是倒数第二篇. 不得不忠谢这合作的力量. 原译文链接:http://blog.csdn.net/qq_18408937/article/details/47452299 LeapUnityExtensions类提供了从Unity坐标系到Leap坐标系的各种转换功能. LeapUnityExtensions LeapUnity扩展 class Leap:UnityVectorExtension  Leap类(