Table of Contents

Class OpenXRHmd

Namespace
Stride.VirtualReality
Assembly
Stride.VirtualReality.dll
public class OpenXRHmd : VRDevice, IDisposable
Inheritance
OpenXRHmd
Implements
Inherited Members
Extension Methods

Constructors

OpenXRHmd(GraphicsDevice)

public OpenXRHmd(GraphicsDevice gd)

Parameters

gd GraphicsDevice

Fields

Instance

public Instance Instance

Field Value

Instance

Xr

public XR Xr

Field Value

XR

extensions

public static List<string> extensions

Field Value

List<string>

globalActionSet

public ActionSet globalActionSet

Field Value

ActionSet

globalFrameState

public FrameState globalFrameState

Field Value

FrameState

globalPlaySpace

public Space globalPlaySpace

Field Value

Space

globalSession

public Session globalSession

Field Value

Session

globalSwapchain

public Swapchain globalSwapchain

Field Value

Swapchain

handProfileState

public InteractionProfileState handProfileState

Field Value

InteractionProfileState

images

public SwapchainImageD3D11KHR[] images

Field Value

SwapchainImageD3D11KHR[]

play_space_type

public ReferenceSpaceType play_space_type

Field Value

ReferenceSpaceType

render_targets

public RenderTargetView[] render_targets

Field Value

RenderTargetView[]

system_id

public ulong system_id

Field Value

ulong

Properties

ActualRenderFrameSize

public override Size2 ActualRenderFrameSize { get; protected set; }

Property Value

Size2

CanInitialize

public override bool CanInitialize { get; }

Property Value

bool

CanMirrorTexture

public override bool CanMirrorTexture { get; }

Property Value

bool

HeadAngularVelocity

public override Vector3 HeadAngularVelocity { get; }

Property Value

Vector3

HeadLinearVelocity

public override Vector3 HeadLinearVelocity { get; }

Property Value

Vector3

HeadPosition

public override Vector3 HeadPosition { get; }

Property Value

Vector3

HeadRotation

public override Quaternion HeadRotation { get; }

Property Value

Quaternion

LeftHand

public override TouchController LeftHand { get; }

Property Value

TouchController

MirrorTexture

public override Texture MirrorTexture { get; protected set; }

Property Value

Texture

OptimalRenderFrameSize

public override Size2 OptimalRenderFrameSize { get; }

Property Value

Size2

RenderFrameScaling

public override float RenderFrameScaling { get; set; }

Property Value

float

RightHand

public override TouchController RightHand { get; }

Property Value

TouchController

State

public override DeviceState State { get; }

Property Value

DeviceState

TrackedItems

public override TrackedItem[] TrackedItems { get; }

Property Value

TrackedItem[]

Methods

CheckResult(Result, string)

A simple function which throws an exception if the given OpenXR result indicates an error has been raised.

protected static Result CheckResult(Result result, string forFunction)

Parameters

result Result

The OpenXR result in question.

forFunction string

Returns

Result

The same result passed in, just in case it's meaningful and we just want to use this to filter out errors.

Exceptions

Exception

An exception for the given result if it indicates an error.

Commit(CommandList, Texture)

public override void Commit(CommandList commandList, Texture renderFrame)

Parameters

commandList CommandList
renderFrame Texture

Dispose()

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

public override void Dispose()

Draw(GameTime)

public override void Draw(GameTime gameTime)

Parameters

gameTime GameTime

Enable(GraphicsDevice, GraphicsDeviceManager, bool, int, int)

public override void Enable(GraphicsDevice device, GraphicsDeviceManager graphicsDeviceManager, bool requireMirror, int mirrorWidth, int mirrorHeight)

Parameters

device GraphicsDevice
graphicsDeviceManager GraphicsDeviceManager
requireMirror bool
mirrorWidth int
mirrorHeight int

GetSwapchainImage()

public uint GetSwapchainImage()

Returns

uint

ReadEyeParameters(Eyes, float, float, ref Vector3, ref Matrix, bool, bool, out Matrix, out Matrix)

public override void ReadEyeParameters(Eyes eye, float near, float far, ref Vector3 cameraPosition, ref Matrix cameraRotation, bool ignoreHeadRotation, bool ignoreHeadPosition, out Matrix view, out Matrix projection)

Parameters

eye Eyes
near float
far float
cameraPosition Vector3
cameraRotation Matrix
ignoreHeadRotation bool
ignoreHeadPosition bool
view Matrix
projection Matrix

Recenter()

public override void Recenter()

SetTrackingSpace(TrackingSpace)

public override void SetTrackingSpace(TrackingSpace space)

Parameters

space TrackingSpace

Update(GameTime)

public override void Update(GameTime gameTime)

Parameters

gameTime GameTime

UpdateViews()

public void UpdateViews()