前言:

感谢关注和支持这个Leap Motion系列翻译的朋友们,非常抱歉因为工作原因非常久没有更新,今后这个翻译还会继续(除非官方直接给出中文文档)。本篇献给大家的是
《FingerModel (手指模型)》 ,该类主要用于手指模型的创建、更新、信息获取及控制等。

FingerModel¶  手指模型类

FingerModel is the base class for all the other finger scripts. If you are creating your own fingers and need a custom finger script, extend FingerModel and implement the
Init() and Update() methods.

手指模型类(FingerModel)是其它手指脚本的基类。假设你要创建自己的手指对象和子定义的手指脚本,那么就须要继承该类并实现Init()方法和Updata()方法。

class FingerModel 手指模型

The base class for all fingers.

全部手指类的基类。

This class serves as the interface between the
HandController object, the parent Hand object and the concrete finger objects.

Subclasses of FingerModel must implement
InitFinger() and UpdateFinger(). The InitHand() function is typically called by the parent
HandModel InitHand() method; likewise, the
UpdateFinger() function is typically called by the parent HandModel UpdateHand() function.

该类是HandController对象,手型父对象以及固定手指对象的接口。

手指模型类(FingerModel)的子类必须实现InitFinger() 和 UpdateFinger() 方法。InitHand() 方法通常由其父类HandModel类的InitHand() 方法调用;相同的。UpdateFinger() 方法通常被其父类HandModel类的UpdateHand() 方法调用。

Public Functions  公共函数

Vector3 GetBoneCenter(int bone_type)   获取骨骼中心(參数:骨骼类型)

Returns the center of the given bone on the finger in relation to the controller.

返回给定手指骨骼相对于控制器的中心点位置。

Vector3 GetBoneDirection(int bone_type) 获取骨骼方向(參数:骨骼类型)

Returns the direction the given bone is facing on the finger in relation to the controller.

返回给定手指骨骼相对于控制器的面向的方向。

float GetBoneLength(int bone_type) 获取骨骼长度(參数:骨骼类型)

Returns the length of the finger bone.

返回手指骨骼的长度。

Quaternion GetBoneRotation(int bone_type) 获取骨骼角度(參数:骨骼类型)

Returns the rotation quaternion of the given bone in relation to the controller.

返回给定的骨骼相对于控制器的旋转角度,以四元数表示。

float GetBoneWidth(int bone_type) 获取骨骼宽度(參数:骨骼类型)

Returns the width of the finger bone.

返回手指骨骼的宽度。

HandController
GetController() 获取控制器

The parent HandController instance.

父对象 手部控制器的实例。

float GetFingerJointSpreadMecanim()  获取手指关节伸张机制

Returns Mecanim spread angle, which only applies to joint_type = 0 NOTE: Positive spread is towards thumb for index and middle, but is in the opposite direction for the ring and pinky.

For the thumb negative spread rotates the thumb in to the palm.

返回伸张角度。仅适用于关节类型(joint_type)为0的情形。

注意:正的伸张朝向大拇指、食指和中指。反之则朝向无名指和小拇指。

float GetFingerJointStretchMecanim(int joint_type) 获取手指关节舒展机制(參数:关节类型)

Returns Mecanim stretch angle in the range (-180, +180] NOTE: Positive stretch opens the hand.

For the thumb this moves it away from the palm.

返回舒展的角度介于 (-180, +180]。注意:正值表示张开手掌,对于大拇指而言,指的是离开手掌的角度。

Vector3 GetJointPosition(int joint) 获取关节位置(參数:关节)

Returns the location of the given joint on the finger in relation to the controller.

返回给定手指关节相对于控制器的位置。

Finger GetLeapFinger() 获取Leap手指

The Leap Finger object.

获取Leap手指对象。

Hand GetLeapHand() 获取Leap手型

The Leap Hand object.

获取Leap手型对象。

Vector3 GetOffset() 获取偏移量

Returns any additional movement the finger needs because of non-relative palm movement.

返回因为非相对的手掌运动导致的手指的额外移动量。

Ray GetRay() 获取射线

Returns a ray from the tip of the finger in the direction it is pointing.

返回从手指指尖及所指向的方向产生的射线。

Vector3 GetTipPosition() 获取指尖位置

Returns the location of the tip of the finger in relation to the controller.

返回手指指尖相对于控制器的位置。

void InitFinger()  初始化手指

Implement this function to initialize this finger after it is created.

Typically, this function is called by the parent
HandModel object.

实现该函数。用于创建手指后进行初始化。

一般来说。该方法由HandModel父对象调用。

void MirrorZAxis(bool mirror = true) 按Z轴镜像

Sets the mirror z-axis flag for this Finger Model.

给手指模型设置Z轴标识。

Mirroring the z axis reverses the hand so that they face the opposite direction as if in a mirror.

沿着Z轴对手型进行镜像。

Parameters 參数


mirror - Set true, the default value to mirror; false for normal rendering.


镜像 - 假设为真(默认值)。产生镜像;否则正常渲染。

void SetController(HandController
controller)  设置控制器(參数:手部控制器)

Assigns the HandController parent for this
FingerModel object.

给当前手指模型对象加入手部控制器父对象。

void SetLeapHand(Hand hand) 设置Leap手型(參数:手型)

Sets the Leap Hand and Leap Finger for this finger.

Note that Leap Hand and Finger objects are recreated every frame. The parent
HandModel object calls this function to set or update the underlying finger. The tracking data in the Leap objects are used to update the
FingerModel.

给当前手指设置Leap 手型和Leap 手指。

注意:Leap手型和手指对象会逐帧重建。其父对象手部控制器调用该方法设置或更行其手指。Leap对象中的追踪数据被用于更新手指模型。

void SetOffset(Vector3 offset) 设置偏移量(參数:偏移量)

Sets an offset vector to displace the finger from its normally calculated position relative to the
HandController.

Typically, this offset is used to give the virtual hands a larger range of motion then they would have based on their scaled size in the Unity scene.

通过设置偏移量。重置手指相对于手部控制器的正常计算位置。

通常,该偏移量用于提供虚拟手型更大的移动范围。从而适用于Unity场景中的缩放。

abstract void UpdateFinger()  更新手指

Implement this function to update this finger once per game loop.

Typically, this function is called by the parent
HandModel object’s UpdateHand() function, which is called in the Unity Update() phase for graphics hand models and in the FixedUpdate() phase for physics hand models.

实现该函数将在每一次游戏循环中得到更新。

一般而言,给方法由其父对象手部模型的UpdateHand() 方法调用。在Unity中,图形手部模型由Update() 阶段调用,而物理手部模型由FixedUpdate() 阶段调用。

Public Members  公共成员

Transform[] bones   骨骼

Bones positioned and rotated by
FingerModel.

由手指模型类控制位置和旋转的骨骼变换。

Transform[] joints  关节

Joints positioned and rotated by
FingerModel.

由手指模型类控制位置和旋转的关节变换。

const int NUM_BONES  骨骼数量

The number of bones in a finger.

手指骨骼数量。

const int NUM_JOINTS  关节数量

The number of joints in a finger.

手指关节数量。

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

很多其它參考:

【VR】Leap Motion 官网文档 脚本參考(文件夹)

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

【VR】Leap Motion 官网文档 FingerModel (手指模型)的更多相关文章

  1. 部署openstack的官网文档解读mysql的配置文件

    部署openstack的官网文档解读mysql的配置文件(使用与ubutu和centos7等系统) author:headsen chen  2017-10-12 16:57:11 个人原创,严禁转载 ...

  2. redis过期机制(官网文档总结)

    官网地址:https://redis.io/commands/expire redis过期定义如下: Set a timeout on key. After the timeout has expir ...

  3. Hortonworks官网文档怎么找?

    Hortonworks官网文档怎么找? 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 俗话说,授人予鱼不如授人予渔,网上部署HDP的部署方式的博客有很多,看得你是眼花缭乱的.其实万 ...

  4. Unity shader 官网文档全方位学习(一)

    转载:https://my.oschina.net/u/138823/blog/181131 摘要: 这篇文章主要介绍Surface Shaders基础及Examples详尽解析 What?? Sha ...

  5. Spring Security 官网文档学习

    文章目录 通过`maven`向普通的`WEB`项目中引入`spring security` 配置 `spring security` `configure(HttpSecurity)` 方法 自定义U ...

  6. mybatis官网文档mybatis_doc

    在平时的学习中,我们可以去参考官网的文档来学习,这个文档有中文的,方便我们去阅读,而且这里的分类很详细. 官网文档链接:http://www.mybatis.org/mybatis-3/zh/inde ...

  7. 你会阅读appium官网文档吗

    高效学习appium第一步,学会查看appium官方文档.如果能把appium文档都通读一遍,对学习appium大有益处. 而能做到通读appium官方文档的人,想必不是很多,刚开始学习appium的 ...

  8. git研究详解(官网文档)及总结

    前言:git作为新一代的版本控制软件,说实话比svn好用多了,个人见解,关于git的详细介绍及研究,我推荐三个地方 1.git官网上的文档(推荐UC浏览器,比火狐多个英文翻译的功能) 地址为:http ...

  9. redis module 学习—官网文档整理

    前言 redis在4.0版本中,推出了一个非常吸引的特性,可以通过编写插件的模式,来动态扩展redis的能力.在4.0之前,如果用户想拥有一个带TTL的INCRBY 命令,那么用户只能自己去改代码,重 ...

随机推荐

  1. oracle中用SQL语句创建和管理表

    表名和列名的命名规则: 必须以字母开头 必须在1-30个字符之间 只能包含A-Z,a-z,0-9,_,$,# 不能与用户定义的其它对象重名 不能使用ORACLE的保留字 创建前具备的条件: CREAT ...

  2. c# 创建socket客户端

    c# 创建socket客户端 using System; using System.Collections.Generic; using System.Linq; using System.Text; ...

  3. 【WPF】当 ItemsSource 正在使用时操作无效。改用 ItemsControl.ItemsSource 访问和修改元素

    问题: 中文版报错:Additional information: 当 ItemsSource 正在使用时操作无效.改用 ItemsControl.ItemsSource 访问和修改元素. 英文版报错 ...

  4. 设计和开发ETL系统(二)——启动

    在针对某个维度模型开始ETL系统设计之前,应当完成逻辑设计,草拟高层架构计划,并且为所有的数据元素拟定源到目标映射. ETL的设计过程十分重要: 收集所有的相关信息,包括事物处理系统中所允许的提取处理 ...

  5. C/C++捕获段错误,打印出错的具体位置(精确到哪一行)_转

    转自:C/C++捕获段错误,打印出错的具体位置(精确到哪一行) 修订:2013-02-16 其实还可以使用 glibc 的 backtrace_symbols 函数,把栈帧各返回地址里面的数字地址翻译 ...

  6. shell命令之根据字符串查询文件对应行记录

    显示xxx字符串对应的行数,并向前打印3行,向后打印2行,查找对应文件为filename.txt 命令:grep -n 'xxx' -A3 -B2 --color=auto filename.txt ...

  7. Lua语言开发Cocos2d-x游戏视频教程第L0401课-Cocos2d-x中使用Lua

    http://www.eoeandroid.com/thread-320733-1-1.html

  8. vmware克隆Centos6.4虚拟机网卡无法启动问题

    vmware克隆Centos6.4虚拟机网卡无法启动问题                 2014-02-26 16:44:54 标签:老男孩培训 vmware克隆问题 网卡无法启动          ...

  9. [mysql] MySQL Order By Rand()效率【转载】

    最近由于需要大概研究了一下MYSQL的随机抽取实现方法.举个例子,要从tablename表中随机提取一条记录,大家一般的写法就是:SELECT * FROM tablename ORDER BY RA ...

  10. mac for appium环境安装

    之前写过windows 安装appium环境步骤. 1. 需求的前置条件如下 (mac 自动git.ruby.brew命令): 2. java  环境 3. git 环境 4. ruby环境 5. b ...