Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

OpenXRHapticVibration

继承: OpenXRHapticBase < Resource < RefCounted < Object

振动触觉反馈。

描述

该触觉反馈资源能够定义基于振动的触觉反馈脉冲,该脉冲可以通过 OpenXR 动作映射中的动作触发。

属性

float

amplitude

1.0

int

duration

-1

float

frequency

0.0


属性说明

float amplitude = 1.0 🔗

  • void set_amplitude(value: float)

  • float get_amplitude()

脉冲的幅度,在 0.01.0 之间。


int duration = -1 🔗

  • void set_duration(value: int)

  • int get_duration()

脉冲的持续时间,单位为纳秒。使用 -1 表示当前 XR 运行时的最小持续时间脉冲。


float frequency = 0.0 🔗

  • void set_frequency(value: float)

  • float get_frequency()

脉冲的频率,单位为赫兹。0.0 会让 XR 运行时为所使用的设备选择最佳频率。