跳转至

ARVRServer

继承

Object

简要描述

AR和VR功能的服务器。

描述

AR/VR服务器是虚拟现实解决方案的核心,并负责所有处理。

成员

类型 属性名 默认值
ARVRInterface primary_interface
float world_scale 1.0

方法

返回值类型 方法名称
void center_on_hmd(rotation_mode: int, keep_height: bool)
ARVRInterface find_interface(name: String) const
Transform get_hmd_transform()
ARVRInterface get_interface(idx: int) const
int get_interface_count() const
Array get_interfaces() const
int get_last_commit_usec()
int get_last_frame_usec()
int get_last_process_usec()
Transform get_reference_frame() const
ARVRPositionalTracker get_tracker(idx: int) const
int get_tracker_count() const

信号

  • interface_added

添加新接口时触发。


  • interface_removed

删除接口时触发。


  • tracker_added

添加新的跟踪器时触发。


  • tracker_removed

删除跟踪器时触发。


枚举

enum TrackerType: - TRACKER_CONTROLLER = 1

跟踪控制器的位置。

  • TRACKER_BASESTATION = 2

跟踪基站的位置。

  • TRACKER_ANCHOR = 4

跟踪AR锚点的位置和大小。

  • TRACKER_ANY_KNOWN = 127

在内部用于过滤任何已知类型的跟踪器。

  • TRACKER_UNKNOWN = 128

如果尚未设置跟踪器类型,则在内部使用。

  • TRACKER_ANY = 255

在内部用于选择所有跟踪器。


enum RotationMode: - RESET_FULL_ROTATION = 0

完全重置HMD的方向。

  • RESET_BUT_KEEP_TILT = 1

重置方向,但保持设备倾斜。

  • DONT_RESET_ROTATION = 2

不重置HMD的方向,仅将播放器的位置居中。


常量

成员说明

  • ARVRInterface primary_interface
setter set_primary_interface(value)
getter get_primary_interface
  • float world_scale
Default 1.0
setter set_world_scale(value)
getter get_world_scale

方法说明

  • center_on_hmd center_on_hmd(rotation_mode: int, keep_height: bool)

这是重要功能。

对于不提供空间跟踪的平台,我们的原点(0,0,0)是我们HMD的位置,但是几乎无法控制玩家在现实世界中所面对的方向。

对于确实提供空间跟踪的平台,我们的起点在很大程度上取决于系统。

此方法可以将跟踪器定位在HMD的位置上。

为了使这种方法产生可用的结果,必须提供跟踪信息。

几秒钟后,应该调用此方法。


  • find_interface find_interface(name: String) const

通过接口名称查找接口。


  • get_hmd_transform get_hmd_transform()

返回主接口的转换。


  • get_interface get_interface(idx: int) const

返回在接口列表中给定索引处注册的接口。


  • get_interface_count get_interface_count() const

返回当前在AR/VR服务器上注册的接口数。


  • get_interfaces get_interfaces() const

返回可用接口的列表,每个接口的ID和名称。


  • get_last_commit_usec get_last_commit_usec()

返回AR/VR眼睛对VisualServer的最后一次ARVRServer提交的绝对时间戳(以μs为单位)。


  • get_last_frame_usec get_last_frame_usec()

返回最后一帧的持续时间(以μs为单位)。


  • get_last_process_usec get_last_process_usec()

返回上一个ARVRServer进程回调的绝对时间戳(以μs为单位)。


  • get_reference_frame get_reference_frame() const

返回参考帧变换。


  • get_tracker get_tracker(idx: int) const

返回给定ID的位置跟踪器。


  • get_tracker_count get_tracker_count() const

返回当前注册的跟踪器的数量。