位置: 编程技术 - 正文

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

编辑:rootadmin
前言:

推荐整理分享【VR】Leap Motion 官网文档 HandModel(手部模型)(vr moke),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:vr moke,#vr#,vr revive,vrbrations,#vr#,#vr#,vr project,vr the,内容如对您有帮助,希望把文章链接给更多的朋友!

本系列译文是为迎合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 custom hand script to go with them, extend HandModel and implement the Init() and Update() methods. You may need to extend the FingerModel class, too.

手部模型是其它手部脚本的基础类。如果你想创建自己的手并需要一个自定义的手部脚本添加在上面,那么就需要继承HandModel类并实现它的Init( ) 和 Update( ) 方法。同时你还需要扩展FingerModel(手指模型)类。

class HandModel 手部模型类

The base class for all hand models, both graphics and physics.

所有手部模型的基类,包括图形的和物理的。

This class serves as the interface between the HandController object and the concrete hand object containing the graphics and physics of a hand.

该类是HandController(手部控制器)对象和包含了图形及物理手模型的实体手的借口。

Subclasses of HandModel must implement InitHand() and UpdateHand(). The UpdateHand() function is called in the Unity Update() phase for graphics HandModel instances; and in the Unity FixedUpdate() phase for physics objects.InitHand() is called once, when the hand is created and is followed by a call to UpdateHand().

HandModel类的子类必须实现InitHand() 和 UpdateHand()。 UpdateHand() 函数在Unity脚本的Update() 方法阶段被调用时,用于图形 HandModel的实例;而在Unity脚本的FixedUpdate()阶段调用时用于物理对象。InitHand() 只在手部创建后被调用一次,之后UpdateHand()被调用。

Public Functions 公共函数

Vector3 GetArmCenter() 获取手臂中心

Calculates the center of the forearm relative to the controller.计算前臂相对于控制器的中心。

Return 返回&#;A Vector3 containing the Unity coordinates of the center of the forearm.前臂中心点的Unity坐标,为Vector3类型。Vector3 GetArmDirection() 获取手臂方向

Calculates the direction vector of the forearm relative to the controller.计算前臂相对于控制器的方向。

Return 返回&#;A Vector3 representing the direction of the forearm (pointing from elbow to wrist).代表前臂方向的Vector3向量(从肘部指向手腕)。float GetArmLength() 获取手臂长度

Returns the measured length of the forearm in meters.返回以米为单位的前臂长度。

Quaternion GetArmRotation() 获取手臂旋转角度

Calculates the rotation of the forearm relative to the controller.计算前臂相对于控制器的旋转角度。

Return 返回&#;A Quaternion representing the rotation of the arm relative to the controller.手臂相对于控制器的旋转角度,以四元数表示。float GetArmWidth() 获取手臂宽度

Returns the measured width of the forearm in meters.以米为单位返回前臂的宽度。

HandController GetController() 获取控制器

The parent HandController object of this hand.该手部的HandController(手部控制器)父对象。

Vector3 GetElbowPosition() 获取肘部位置

Calculates the position of the elbow relative to the controller.计算肘部相对于控制器的位置。

Return 返回&#;A Vector3 containing the Unity coordinates of the elbow.肘部的Unity坐标,Vector3类型。Vector3 GetHandOffset() 获取手部偏移量

Calculates the offset between the wrist position and the controller based on theHandController.handMovementScale property and the Leap hand wrist position.计算基于HandController.handMovementScale属性的控制器肘部位置和Leap手肘部位置的偏移量。

Hand GetLeapHand() 获取Leap手部

Returns the Leap Hand object represented by this HandModel.返回一个由当前HandModel(手部模型)表示的Leap手对象。

Note that any physical quantities and directions obtained from the Leap Hand object are relative to the Leap Motion coordinate system, which uses a right-handed axes and units of millimeters.需要注意的是,从Leap 手部对象获取的物理数量和方向是相对于Leap Motion 坐标系的。该坐标系使用右手坐标系统并以毫米为单位。

Vector3 GetPalmDirection() 获取手掌方向

Calculates the direction vector of the hand relative to the controller.计算手掌相对于控制器的方向向量。

Return 返回&#;A Vector3 representing the direction of the hand relative to the controller.手掌相对于控制器的方向,Vector3类型。Vector3 GetPalmNormal() 获取手掌法线

Calculates the normal vector projecting from the hand relative to the controller.计算手掌相对于控制器的法线向量。

Return 返回&#;A Vector3 representing the vector perpendicular to the palm.垂直于手掌平面的向量,Vector3类型。Vector3 GetPalmPosition() 获取手掌位置

Calculates the position of the palm relative to the controller.计算手掌相对于控制器的位置。

Return 返回&#;A Vector3 containing the Unity coordinates of the palm position.手掌位置的Unity坐标,Vector3类型。Quaternion GetPalmRotation() 获取手掌角度

Calculates the rotation of the hand relative to the controller.计算手掌相对于控制器的角度。

Return 返回&#;A Quaternion representing the rotation of the hand relative to the controller.手掌相对于控制器的四元数角度,Quaternion类型。Vector3 GetWristPosition() 获取肘部位置

Calculates the position of the wrist relative to the controller.计算肘部相对于控制器的位置。

Return 返回&#;A Vector3 containing the Unity coordinates of the wrist.肘部的Unity坐标,Vector3类型。void InitHand() 初始化手部 【译者注:重要】

Implement this function to initialise this hand after it is created.实现该函数,在手部被创建后进行初始化。

This function is called by the HandController during the Unity Update() phase when a new hand is detected by the Leap Motion device.当Leap Motion 设备检测到一个新的手时,该函数就会在Unity脚本的Update()阶段被HandController调用。

bool IsMirrored() 是否是镜像的

Whether this hand is currently mirrored.当前的手是否是镜像的。

void MirrorZAxis(bool mirror = true) 镜像Z轴【VR】Leap Motion 官网文档 HandModel(手部模型)(vr moke)

Sets the mirror z-axis flag for this Hand Model and its fingers.为该手部模型及其手指设置镜像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) 设置控制器

Sets the parent HandController object.设置手部控制器父对象。

void SetLeapHand(Hand hand) 设置Leap手部

Assigns a Leap Hand object to this hand model. 给当前手模型设置一个Leap手部。

Note that the Leap Hand objects are recreated every frame. The parent HandController calls this method to set or update the underlying hand.需要注意的是,Leap手部每一帧都会被重新创建。父对象HandController调用该方法用于设置和更新原本的手部。

abstract void UpdateHand() 更新手部 【译者注:重要】

Implement this function to update this hand once every game loop.实现该函数,用于在每次游戏循环中更新一次手部。

For HandModel instances assigned to the HandController graphics hand list, the HandController calls this function during the Unity Update() phase. For HandModel instances in the physics hand list, theHandController calls this function in the FixedUpdate() phase.对于HandController图形手部列表中的HandModel实例,HandController将在Unity脚本的Update() 阶段调用该方法。对于HandController图形物理列表中的HandModel实例,HandController将在Unity脚本的FixedUpdate() 阶段调用该方法。

Public Members 公共成员

FingerModel [] fingers 手指模型

The array of finger objects for this hand.该手部的手指对象数组。

The array is ordered from thumb (element 0) to pinky (element 4).该数组顺序是从大拇指(下标为0)到小手指(下标为0)。

float handModelPalmWidth 手掌模型宽度

The model width of the hand in meters.以米为单位衡量手掌模型宽度。

This value is used with the measured value of the user’s hand to scale the model proportionally.该&#;和用户手部测量&#;一起,用于恰当的缩放模型。

const int NUM_FINGERS 手指数量

The number of fingers on a hand.一个手上的手指数量。

DebugHand 调试手型

The DebugHand draws no graphics in a Game view, but draws lines for the parts of the hand in the Scene view. Use the DebugHand when you do not want visible hands, but want to see where the hands are in the Scene view.调试手型不会在Game(游戏)试图中绘制任何徒刑,但会用线型将手的各个部分绘制在Scene(场景)视图中。调试手型一般用于不希望看到手型,但想在Scene(场景)视图中看到的情形。

class DebugHand 调试手型类

A HandModel that draws lines for the bones in the hand and its fingers. 绘制手部和手指骨骼线条的手部模型。

The debugs lines are only drawn in the Editor Scene view (when a hand is tracked) and not in the Game view. Use debug hands when you aren’t using visible hands in a scene so that you can see where the hands are in the scene view.

Public Functions

override void InitHand()

Initializes the hand and calls the line drawing function.

override void UpdateHand()

Updates the hand and calls the line drawing function.

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

更多参考:

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

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

unity3d 在shader中创建及使用Texture3D 代码来自ArasTexture3D必须要在脚本中创建c#:spanstyle=font-size:px;usingUnityEngine;publicclassCreate3DTex:MonoBehaviour{publicTexture3Dtex;publicintsize=;voidStart(){tex=newTexture3D(s

[Unity3D]UI方案及制作细节(NGUI/EZGUI/原生UI系统) 转载请留下本文原始链接,谢谢。本文会不定期更新维护,最近更新于..。

Unity3d Asset Serialization 设置错误导致SVN文件不能同步 在Unity3d编辑器中创建一个物体,然后保存为Prefab。上传到SVN中,在团队协作中很正常的一个操作,但是因为Unity的配置问题,在另外的电脑上下载过来

标签: vr moke

本文链接地址:https://www.jiuchutong.com/biancheng/369302.html 转载请保留说明!

上一篇:NGUI所见即所得之深入剖析UIPanel,UIWidget,UIDrawCall底层原理(所见即所得出自哪里)

下一篇:unity3d 在shader中创建及使用Texture3D(unity shader lod)

  • 增值税发票认证在哪里
  • 发票章是否需要到税务局备案
  • 企业出租房产增值税率
  • 减免增值税计入其他收益
  • 软件平台服务公司的营业执照经营范围怎么写
  • 有营业执照有什么好处吗?
  • 用于职工住宿的会计科目
  • 受托加工怎么做账
  • 自行建造固定资产的计税基础
  • 车辆租赁费可以开专票吗
  • 小规模纳税人进项税额怎么处理
  • 建造合同中甲供材选择一般计税还是简易计税更省税?
  • 增值税税率改革的意义
  • 盈余公积为0说明什么问题
  • 未确认收入的增值税怎么记账
  • 家具属于固定资产什么类别
  • 苹果手机搜不到airpods
  • packethsvc.exe - packethsvc是什么进程 有什么用
  • 土地使用税如何终止申报
  • php自定义变量
  • 酒店购啤酒属于什么科目
  • 包装物损坏无法确认
  • 公司付物业费没开发票
  • 会计分录由什么要素组成
  • 建筑装饰工程公司取名
  • 固定资产清理损失可以税前扣除吗
  • yolov1训练过程
  • thinkphp框架入门
  • 年报写歇业 可以写多久
  • php js
  • 高温补贴入账科目
  • 给客户开的发票,在邮寄过程中丢了怎么办?
  • 升级nodejs到最新版本
  • vue前端模板网站
  • 阿里巴巴达摩院ai
  • php程序技术
  • php对接公众号支付
  • 帝国cms栏目可以看吗
  • 百度地图api3.0
  • macos装mysql
  • 实施资本公积金的目的
  • 债权人豁免债务的账务处理会计分录
  • 怎么修改申报数据
  • 外购货物用于公益性捐赠
  • 股东的报销款可以抵投资款吗
  • 资产负债表中其他流动资产包括哪些
  • 异常凭证进项税额转出怎么申报
  • 什么企业的应急预案需要备案
  • 办公室购花卉会计处理
  • 企业预付款属于负债吗
  • 财务费用利息收入的账务处理
  • 以非货币形式出资应办理什么手续
  • 个人贷款打到公司账户存在什么风险
  • 包装袋制版费
  • 不含税价换算成含税价怎么算
  • 明细账建账的步骤
  • mysql5624安装教程
  • mysql修改默认字符集和校对规则
  • sql修改表的所属空间
  • win7支持net.framework4.7.2
  • centos怎么调出终端
  • 苹果mac安装
  • openwrt 路由配置梯子
  • 在Linux系统中安装镜像步骤
  • linux中bc命令
  • win7系统怎么关闭防火墙设置
  • fp3是什么文件格式
  • node.js加密
  • Android OpenGL ES(七)----理解纹理与纹理过滤
  • shell脚本for循环 计算1到100的和
  • js鼠标移入事件
  • js如何将输入的数存到数组中
  • 批量修改ssh配置端口
  • 如何用jquery
  • javascript面向对象精要pdf下载
  • 说几条javascript的基本规范
  • 西安市交房要交多少钱
  • 成都交房需要交什么费用
  • 如何查询房屋契税是否退还
  • 江苏省高中教师资格证考试科目
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设