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


ToolModel  工具模型

ToolModel updates a model’s position and orientation based on a tracked tool. Compared to hands, tools are very simple and have no internal articulations. GameObjects used for tools should include any needed rigid bodies and colliders for interation with the Unity world.

工具模型基于追踪到的工具来更新模型的位置和角度。和手型相比,工具非常简单,并且没有内在的表达式。被用作工具的游戏对象需要包含所需要的刚体和碰撞器组件,以便于Unity中的物体进行物理交互。


 

A flashlight is one of the example tools included with the core asset package.

手电筒是核心资源包中所包含的典型示例工具之一。



class ToolModel  工具模型类

Updates a tool model based on tracking data from the Leap Motion service/daemon.

基于Leap Motion 服务或后台驻留程序追踪数据来更新工具模型。


In the Leap Motion API, tools represent long, thin objects, like a pencil, which can be tracked by the Leap Motion sensor. Tools are not associated with hands.

在Leap Motion API当中,工具代表细长的物体,像一个铅笔一样,这类物体可以被Leap Motion感应器追踪。工具与手型无关。


A GameObject representing the tool graphics and with this script attached can be added to a HandController‘s ToolModel slot. The HandController will spawn instances of the game object, updates its position during its lifetime, and finally, destroy the spawned instance when tracking of the tool is lost.

一个代表工具图形且附带有脚本的游戏对象能够被添加到手部控制器的工具模型属性槽里。手部控制器会生成游戏对象的实例,实时更新它的位置,最后当工具跟踪失效时销毁所生成的实例。


Public Functions 公共函数


HandController GetController() 获取控制器


The Leap Controller object  tracking data.

Leap控制器对象提供跟踪数据。


Tool GetLeapTool() 获取Leap工具


The Leap Tool object.

Leap工具对象。


Quaternion GetToolRotation() 获取工具旋转角度


The local rotation of this tool based on the tracked tool, the HandController, and the mirror setting.

基于跟踪工具,手部控制器和镜像设置计算的该工具旋转角度。


Vector3 GetToolTipPosition() 获取工具顶端位置


The position of the tip of this tool in the Unity scene.

在Unity场景中,该工具顶端的位置。


Vector3 GetToolTipVelocity() 获取工具顶端的速度


Calculates the tip velocity of this tool model within the scene.

计算在场景里的工具模型的顶端速度。


void InitTool() 初始化工具


Initalizes the tool by setting its position and orientation.

通过设置工具的位置和角度来初始化该工具。


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


Whether to mirror the tool and motion.

是否镜像工具和运动。


void SetController(HandController controller) 设置控制器


Sets the Leap Controller for this ToolModel.

为当前工具模型设置Leap控制器。


void SetLeapTool(Tool tool) 设置Leap工具


Sets the Leap Tool for this ToolModel.

为当前工具模型设置Leap工具。


void UpdateTool() 更新工具


Updates the tool by setting its position, velocity, and orientation.

通过设置工具的位置,速度和角度来更新该工具。


Public Members 公共变量

float filtering 平滑过度系数

Smoothing factor applied to movement.

用于控制运动的平滑系数。

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值