VRTK 学习记录之 Teleport

VRTK 为我们的开发提供了很多方便,比如移动、抓取、等功能都可以用VRTK实现。今天学习一下VRTK的移动功能。本文中所有的内容都可以在VRTK自带的文档中找到。

 

VRTK的移动是通过游戏世界中的Base Pointer的端点坐标设置实现的。DestinationMarkerSet事件是移动时触发的事件。 

 

VRTK的基础移动(Basic Teleport)参数

Blink Transition Speed

Distance Blink Delay

Headset Position Compensation

Target List Policy

Nav Mesh Limit Distance

 

类事件

Teleporting  Teleported

 

Unity 事件

把VRTK_BasicTeleport_UnityEvents组件加到VRTK_BasicTeleport物体上就可以使用UnityEvents了。

OnTeleporting

OnTeleported

类方法:

public void InitDestinationSetListener(GameObject markerMaker, bool register)

  markerMaker:产生目标标记事件的gameobject。比如controller

  register:决定是否注册或者是不注册这个监听器

  此函数应用于注册监听目标产生事件。

public void ToggleTeleportEnabled(bool state)

  可以允许或者禁止移动


 

除了基础移动类之外,还有一下类可以控制移动

Height Adjust Teleport

Dash Teleport

 

posted @ 2017-04-27 11:56  lpcoder  阅读(389)  评论(0编辑  收藏  举报