Table of Contents

Class VRDevice

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

Constructors

VRDevice()

protected VRDevice()

Properties

ActualRenderFrameSize

public abstract Size2 ActualRenderFrameSize { get; protected set; }

Property Value

Size2

CanInitialize

public abstract bool CanInitialize { get; }

Property Value

bool

CanMirrorTexture

public virtual bool CanMirrorTexture { get; }

Property Value

bool

Game

public GameBase Game { get; }

Property Value

GameBase

HeadAngularVelocity

public abstract Vector3 HeadAngularVelocity { get; }

Property Value

Vector3

HeadLinearVelocity

public abstract Vector3 HeadLinearVelocity { get; }

Property Value

Vector3

HeadPosition

public abstract Vector3 HeadPosition { get; }

Property Value

Vector3

HeadRotation

public abstract Quaternion HeadRotation { get; }

Property Value

Quaternion

LeftHand

public abstract TouchController LeftHand { get; }

Property Value

TouchController

MirrorTexture

public abstract Texture MirrorTexture { get; protected set; }

Property Value

Texture

OptimalRenderFrameSize

public abstract Size2 OptimalRenderFrameSize { get; }

Property Value

Size2

RenderFrameScaling

public abstract float RenderFrameScaling { get; set; }

Property Value

float

RightHand

public abstract TouchController RightHand { get; }

Property Value

TouchController

State

public abstract DeviceState State { get; }

Property Value

DeviceState

SupportsOverlays

public bool SupportsOverlays { get; protected set; }

Property Value

bool

SupportsPassthrough

Whether or not passthrough is supported by the device. It needs to be requested on device creation by enabling RequestPassthrough. If supported, passthrough can be started (and stopped) with the StartPassthrough() method.

public bool SupportsPassthrough { get; protected set; }

Property Value

bool

TrackedItems

public abstract TrackedItem[] TrackedItems { get; }

Property Value

TrackedItem[]

VRApi

public VRApi VRApi { get; protected set; }

Property Value

VRApi

ViewScaling

Allows you to scale the view, effectively it will change the size of the player in respect to the world, turning it into a giant or a tiny ant.

public float ViewScaling { get; set; }

Property Value

float

Remarks

This will reduce the near clip plane of the cameras, it might induce depth issues.

Methods

Commit(CommandList, Texture)

public abstract void Commit(CommandList commandList, Texture renderFrame)

Parameters

commandList CommandList
renderFrame Texture

CreateOverlay(int, int, int, int)

public virtual VROverlay CreateOverlay(int width, int height, int mipLevels, int sampleCount)

Parameters

width int
height int
mipLevels int
sampleCount int

Returns

VROverlay

Dispose()

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

public virtual void Dispose()

Draw(GameTime)

public abstract void Draw(GameTime gameTime)

Parameters

gameTime GameTime

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

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

Parameters

device GraphicsDevice
graphicsDeviceManager GraphicsDeviceManager
requireMirror bool
mirrorWidth int
mirrorHeight int

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

public abstract 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 virtual void Recenter()

ReleaseOverlay(VROverlay)

public virtual void ReleaseOverlay(VROverlay overlay)

Parameters

overlay VROverlay

SetTrackingSpace(TrackingSpace)

public virtual void SetTrackingSpace(TrackingSpace space)

Parameters

space TrackingSpace

StartPassthrough()

Starts a passthrough. When enabled the scene is rendered on top of the camera image of the device.

public virtual IDisposable StartPassthrough()

Returns

IDisposable

A disposable which will stop the passthrough on dispose.

Exceptions

NotSupportedException

Thrown if the passthrough mode is not supported by the device.

InvalidOperationException

Thrown if the passthrough mode is already enabled.

Update(GameTime)

public abstract void Update(GameTime gameTime)

Parameters

gameTime GameTime