Interface IWebXRControllerHapticActuator
interface IWebXRControllerHapticActuator {
effects?: readonly GamepadHapticEffectType[];
playEffect?: (
type: GamepadHapticEffectType,
params?: GamepadEffectParameters,
) => Promise<GamepadHapticsResult>;
reset?: () => Promise<GamepadHapticsResult>;
}
effects?: readonly GamepadHapticEffectType[];
playEffect?: (
type: GamepadHapticEffectType,
params?: GamepadEffectParameters,
) => Promise<GamepadHapticsResult>;
reset?: () => Promise<GamepadHapticsResult>;
}
Properties
Optional Readonlyeffects
effects?: readonly GamepadHapticEffectType[]
The haptic effects reported as supported by this actuator.
Optionalplay Effect
playEffect?: (
type: GamepadHapticEffectType,
params?: GamepadEffectParameters,
) => Promise<GamepadHapticsResult>
type: GamepadHapticEffectType,
params?: GamepadEffectParameters,
) => Promise<GamepadHapticsResult>
Plays a haptic effect, when advanced haptic playback is supported.
Type Declaration
-
- (
type: GamepadHapticEffectType,
params?: GamepadEffectParameters,
): Promise<GamepadHapticsResult> -
The
playEffect()method of the GamepadHapticActuator interface causes the hardware to play a specific vibration effect.Parameters
- type: GamepadHapticEffectType
Optionalparams: GamepadEffectParameters
Returns Promise<GamepadHapticsResult>
- (
Optionalreset
reset?: () => Promise<GamepadHapticsResult>
Stops the active haptic effect, when reset is supported.
Type Declaration
-
- (): Promise<GamepadHapticsResult>
-
The
reset()method of the GamepadHapticActuator interface stops the hardware from playing an active vibration effect.Returns Promise<GamepadHapticsResult>
The haptic capabilities exposed by a WebXR motion controller actuator.