【VR】Leap Motion 官方脚本手册翻译之---HandController(手型控制器)

来源:互联网 发布:外媒特朗普访华 知乎 编辑:程序博客网 时间:2024/05/22 06:36

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 controller检测到相对于预制体的位置和方向而被绘制出来。

这里写图片描述

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这个设备20CM之上的话,虚拟的手型将会被绘制在这个预制体的20CM之上的位置(假如HandController的Transform的Scale属性被设置为1.0)。要注意的是默认的缩放比例是20:1,因此手型被绘制的要比实际尺寸要大些。在Unity的场景视图里,近似的视野Leap Motion传感器将被显示出来。

class 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 Motion)之上。你可以改变预制体的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.
译文:当HandController在场景里被激活时,添加指定的3 d模型手到场景时,现实世界的手将被Leap Motion硬件而追踪。默认情况下,当物理的手丢失或被重新创建时当追踪被重新占用时,这些对象会被销毁。资产包提供了多种类型的手,你可以与手控制器结合使用。

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它自己。

Controller GetLeapController()
Returns the Leap Controller instance.
译文:获取Leap Motion控制器
返回一个Leap Motion控制器的实例

float GetRecordingProgress()
The current frame position divided by the total number of frames in the recording.
译文:获得记录进展
在记录中当前帧的位置除以帧的总数。

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 .
译文:使用 Physics.IgnoreCollisions(). See方法可以看到Unity受到的限制的物体。

bool IsConnected()
True, if the Leap Motion hardware is plugged in and this application is connected to the Leap Motion service.
译文:是否连接
当为True时,Leap Motion硬件插入,这个应用程序连接到Leap Motion服务。

bool IsEmbedded()
True, if the active Leap Motion device is embedded in a laptop or keyboard.
译文:是否嵌入
当为True时,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 object 获取画面而不是 Leap service。

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 是假的,这个游戏对象包含图形使用左手或者双手

HandModel leftPhysicsModel
The GameObject containing colliders to use for the left hand or both hands if separateLeftRight is false.
译文:左手物理模型
如果 separateLeftRight 是假的,这个游戏对象包含碰撞器使用左手或者双手

bool mirrorZAxis
Reverses the z axis.
译文:是否镜像Z轴
反转Z轴

bool recorderLoop
Whether to loop the playback.
译文:是否循环记录
是否循环回放

float recorderSpeed
Playback speed.
Set to 1.0 for normal speed.
译文:记录的速度
回放的速度
设置为1.0时是正常的速度

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).
译文:是否分离左手和右手
是否使用一个单独的左和右的手模型(真);否则,镜像相同的模型(假)。

ToolModel toolModel
The GameObject containing both graphics and colliders for tools.
译文:工具模型
游戏对象包含图形和对撞机的工具。

原文地址:https://developer.leapmotion.com/documentation/unity/unity/Unity.HandController.html

Ps:由于本人英文水平有限,可能会出现翻译不当的,请大家谅解!

0 0
原创粉丝点击