Table of Contents

Class TouchController

Namespace
Stride.VirtualReality
Assembly
Stride.VirtualReality.dll
public abstract class TouchController : IDisposable
Inheritance
TouchController
Implements
Extension Methods

Properties

AngularVelocity

public abstract Vector3 AngularVelocity { get; }

Property Value

Vector3

Grip

public abstract float Grip { get; }

Property Value

float

HapticsSupport

Degree to which this touch controller type supports haptics. None: no haptics support, controller does not vibrate. Limited: cannot vibrate at any specific frequency or amplitude. Corresponding parameter is ignored. Full: vibrate method respects both frequency and vibration parameters

public abstract TouchController.ControllerHaptics HapticsSupport { get; }

Property Value

TouchController.ControllerHaptics

IndexPointing

public abstract bool IndexPointing { get; }

Property Value

bool

IndexResting

public abstract bool IndexResting { get; }

Property Value

bool

LinearVelocity

public abstract Vector3 LinearVelocity { get; }

Property Value

Vector3

Position

public abstract Vector3 Position { get; }

Property Value

Vector3

Rotation

public abstract Quaternion Rotation { get; }

Property Value

Quaternion

State

public abstract DeviceState State { get; }

Property Value

DeviceState

ThumbAxis

public abstract Vector2 ThumbAxis { get; }

Property Value

Vector2

ThumbResting

public abstract bool ThumbResting { get; }

Property Value

bool

ThumbUp

public abstract bool ThumbUp { get; }

Property Value

bool

ThumbstickAxis

public abstract Vector2 ThumbstickAxis { get; }

Property Value

Vector2

Trigger

public abstract float Trigger { get; }

Property Value

float

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public virtual void Dispose()

IsPressReleased(TouchControllerButton)

Returns true if in this frame the button was released

public abstract bool IsPressReleased(TouchControllerButton button)

Parameters

button TouchControllerButton

Returns

bool

IsPressed(TouchControllerButton)

Returns true if button switched is in the pressed state

public abstract bool IsPressed(TouchControllerButton button)

Parameters

button TouchControllerButton

Returns

bool

IsPressedDown(TouchControllerButton)

Returns true if in this frame the button switched to pressed state

public abstract bool IsPressedDown(TouchControllerButton button)

Parameters

button TouchControllerButton

Returns

bool

IsTouchReleased(TouchControllerButton)

Returns true if in this frame the button was released

public abstract bool IsTouchReleased(TouchControllerButton button)

Parameters

button TouchControllerButton

Returns

bool

IsTouched(TouchControllerButton)

Returns true if button switched is in the pressed state

public abstract bool IsTouched(TouchControllerButton button)

Parameters

button TouchControllerButton

Returns

bool

IsTouchedDown(TouchControllerButton)

Returns true if in this frame the button switched to pressed state

public abstract bool IsTouchedDown(TouchControllerButton button)

Parameters

button TouchControllerButton

Returns

bool

Update(GameTime)

public virtual void Update(GameTime time)

Parameters

time GameTime

Vibrate(int, float, float)

Vibrate the controller for a fixed duration. Do so at specified frequency/amplitude if supported by runtime. Oculus runtime supports vibrating at frequency 0.0, 0.5, or 1.0, and amplitude in range [0.0, 1.0] openVR supports vibrating, but does not support frequency or amplitude openXR and WindowsMixedReality currently do not support vibration.

public abstract Task Vibrate(int durationMs, float frequency = 1, float amplitude = 1)

Parameters

durationMs int

Vibration duration, in milliseconds

frequency float

Frequency of vibration in range [0.0, 1.0]

amplitude float

Amplitude of vibration in range [0.0, 1.0]

Returns

Task