Struct HapticCapabilities
Describes the haptic capabilities of a specific device.
Namespace: UnityEngine.InputSystem.XR.Haptics
Assembly: Unity.InputSystem.dll
Syntax
public struct HapticCapabilities
Constructors
HapticCapabilities(uint, bool, bool, uint, uint, uint)
Initializes and returns an instance of HapticCapabilities.
Declaration
public HapticCapabilities(uint numChannels, bool supportsImpulse, bool supportsBuffer, uint frequencyHz, uint maxBufferSize, uint optimalBufferSize)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | numChannels | The number of haptic channels available on this device. |
| bool | supportsImpulse | This device supports sending a haptic impulse. |
| bool | supportsBuffer | This device supports sending a haptic buffer. |
| uint | frequencyHz | The buffer frequency the device operates at in Hertz. |
| uint | maxBufferSize | The max amount of buffer data that can be stored by the device. |
| uint | optimalBufferSize | The optimal size of a device's buffer, taking into account frequency and latency. |
HapticCapabilities(uint, uint, uint)
Deprecated. Use HapticCapabilities(uint, bool, bool, uint, uint, uint) instead. This constructor did not match the native haptic capabilities struct and was missing properties.
Declaration
public HapticCapabilities(uint numChannels, uint frequencyHz, uint maxBufferSize)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | numChannels | The number of haptic channels available on this device. |
| uint | frequencyHz | The buffer frequency the device operates at in Hertz. |
| uint | maxBufferSize | The max amount of buffer data that can be stored by the device. |
Properties
frequencyHz
The buffer frequency the device operates at in Hertz. This impacts how fast the device consumes buffered haptic data.
Declaration
public readonly uint frequencyHz { get; }
Property Value
| Type | Description |
|---|---|
| uint |
Remarks
This value is greater than 0 if supportsBuffer is true, and 0 otherwise.
maxBufferSize
The max amount of buffer data that can be stored by the device.
Declaration
public readonly uint maxBufferSize { get; }
Property Value
| Type | Description |
|---|---|
| uint |
numChannels
The number of haptic channels available on this device.
Declaration
public readonly uint numChannels { get; }
Property Value
| Type | Description |
|---|---|
| uint |
optimalBufferSize
The optimal size of a device's buffer, taking into account frequency and latency.
Declaration
public readonly uint optimalBufferSize { get; }
Property Value
| Type | Description |
|---|---|
| uint |
supportsBuffer
This device supports sending a haptic buffer.
Declaration
public readonly bool supportsBuffer { get; }
Property Value
| Type | Description |
|---|---|
| bool |
See Also
supportsImpulse
This device supports sending a haptic impulse.
Declaration
public readonly bool supportsImpulse { get; }
Property Value
| Type | Description |
|---|---|
| bool |