【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 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 (手指模型)的更多相关文章
- 部署openstack的官网文档解读mysql的配置文件
部署openstack的官网文档解读mysql的配置文件(使用与ubutu和centos7等系统) author:headsen chen 2017-10-12 16:57:11 个人原创,严禁转载 ...
- redis过期机制(官网文档总结)
官网地址:https://redis.io/commands/expire redis过期定义如下: Set a timeout on key. After the timeout has expir ...
- Hortonworks官网文档怎么找?
Hortonworks官网文档怎么找? 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 俗话说,授人予鱼不如授人予渔,网上部署HDP的部署方式的博客有很多,看得你是眼花缭乱的.其实万 ...
- Unity shader 官网文档全方位学习(一)
转载:https://my.oschina.net/u/138823/blog/181131 摘要: 这篇文章主要介绍Surface Shaders基础及Examples详尽解析 What?? Sha ...
- Spring Security 官网文档学习
文章目录 通过`maven`向普通的`WEB`项目中引入`spring security` 配置 `spring security` `configure(HttpSecurity)` 方法 自定义U ...
- mybatis官网文档mybatis_doc
在平时的学习中,我们可以去参考官网的文档来学习,这个文档有中文的,方便我们去阅读,而且这里的分类很详细. 官网文档链接:http://www.mybatis.org/mybatis-3/zh/inde ...
- 你会阅读appium官网文档吗
高效学习appium第一步,学会查看appium官方文档.如果能把appium文档都通读一遍,对学习appium大有益处. 而能做到通读appium官方文档的人,想必不是很多,刚开始学习appium的 ...
- git研究详解(官网文档)及总结
前言:git作为新一代的版本控制软件,说实话比svn好用多了,个人见解,关于git的详细介绍及研究,我推荐三个地方 1.git官网上的文档(推荐UC浏览器,比火狐多个英文翻译的功能) 地址为:http ...
- redis module 学习—官网文档整理
前言 redis在4.0版本中,推出了一个非常吸引的特性,可以通过编写插件的模式,来动态扩展redis的能力.在4.0之前,如果用户想拥有一个带TTL的INCRBY 命令,那么用户只能自己去改代码,重 ...
随机推荐
- C#中一道关于ADO.NET的基础练习题
在控制台程序中实现以下功能: 1. 构建3个表(程序启动时自动建立) (20分): 1) Employee 职工表 (工号.姓名.性别.年龄.部门) (Num.Name.Sex.Age.Depar ...
- 使用 FreeRTOS 时注意事项总结(基础篇教程完结)
以下转载自安富莱电子: http://forum.armfly.com/forum.php FreeRTOS 的初始化流程推荐的初始化流程如下,本教程配套的所有例子都是采用的这种形式,当然,不限制必须 ...
- [转]SQL Server 「逾时过期」的处理方式
基本上 SQL Server 只要在处理大量数据的指令,如 INSERT INTO A SELECT * FROM B 在数据量很大的时候,很容易发生 Timeout ,也就是常见的「逾期过时」错误. ...
- ucenter通信失败和不能登录的解决
对于ucenter真是让人不省心,修改一下url,就通信失败了. 1.通信失败 然后后来怎么也改不好了,后来一步一步打log,发现是uc_server和uc_client不一致. 检查uc_serve ...
- 个推-推送hello world
最近项目中的一个百度推送真是把我搞的有点头大,真的是很垃圾,到达率又低,还特么遇上停止维护了... 所以项目决定转用别的推送平台,现在改用个推,官方文档写的很好,除了刚下载下来,折腾了一阵子,不过很快 ...
- 利用MapReduce实现倒排索引
这里来学习的是利用MapReduce的分布式编程模型来实现简单的倒排索引. 首先什么是倒排索引? 倒排索引是文档检索中最常用的数据结构,被广泛地应用于全文搜索引擎. 它主要是用来存储某个单词(或词组) ...
- Web API(一);Restful架构
一.什么是RESTful REST全称是Representational State Transfer,中文意思是表述(编者注:通常译为表征)性状态转移.REST指的是一组架构约束条件和原则.如果一个 ...
- 七、CentOS 6.5 下 Nginx的反向代理和负载均衡的实现
CentOS 6.5 下 Nginx的反向代理和负载均衡的实现 * 修复上面文章的问题: 复制出一个tomcat2之后,修改service.xml文件时,要修改三个端口: 1. <!-- 800 ...
- Linux进程同步机制
为了能够有效的控制多个进程之间的沟通过程,保证沟通过程的有序和和谐,OS必须提供一定的同步机制保证进程之间不会自说自话而是有效的协同工作.比如在共享内存的通信方式中,两个或者多个进程都要对共享的内存进 ...
- 数据库 Mysql内容补充二
多表查询 mysql支持的是SQL99标准的连接查询,并不支持oracle公司的外连接查询, 但是支持oracle等值查询,不等值查询,自连接查询,子查询(只要不是外连接(+)都支持) oracle也 ...