GvrHeadset

Main entry point for Standalone headset APIs.

Summary

To use this API, use the GvrHeadset prefab. There can be only one such prefab in a scene, since this is a singleton object.

Inheritance

Inherits from: MonoBehaviour
Direct Known Subclasses:GoogleVR.Beta.GvrBetaHeadset

Properties

OnRecenter
Event handlers for OnRecenter.
OnSafetyRegionChange
Event handlers for OnSafetyRegionChange.
ProvidesEditorEmulator
bool
Gets a value indicating whether this headset provides an Editor Emulator.
SupportsPositionalTracking
static bool
Gets a value indicating whether this headset supports 6DoF positional tracking.

Protected functions

GvrHeadset()
Initializes a new instance of the GvrHeadset class.

Public functions

OnRecenterEvent(GvrRecenterEventType recenterType, GvrRecenterFlags recenterFlags, Vector3 recenteredPosition, Quaternion recenteredOrientation)
delegate void
This delegate is called after the headset is recentered.
OnSafetyRegionEvent(bool enter)
delegate void
This delegate is called when the headset crosses the safety region boundary.

Public static functions

TryGetFloorHeight(ref float floorHeight)
bool
Populates floorHeight with the detected height, if one is available.
TryGetRecenterTransform(ref Vector3 position, ref Quaternion rotation)
bool
Populates position and rotation with the last recenter transform, if one is available.
TryGetSafetyCylinderInnerRadius(ref float innerRadius)
bool
Populates innerRadius with the safety cylinder inner radius, if one is available.
TryGetSafetyCylinderOuterRadius(ref float outerRadius)
bool
Populates outerRadius with the safety cylinder outer radius, if one is available.
TryGetSafetyRegionType(ref GvrSafetyRegionType safetyType)
bool
Populates safetyType with the safety region type, if one is available.

Properties

OnRecenter

static OnRecenterEvent OnRecenter

Event handlers for OnRecenter.

Triggered when a recenter command has been issued by the user.

OnSafetyRegionChange

static OnSafetyRegionEvent OnSafetyRegionChange

Event handlers for OnSafetyRegionChange.

Triggered when the safety region has been entered or exited.

ProvidesEditorEmulator

bool ProvidesEditorEmulator

Gets a value indicating whether this headset provides an Editor Emulator.

Value true if this headset provides an Editor Emulator, or false otherwise.

SupportsPositionalTracking

static bool SupportsPositionalTracking

Gets a value indicating whether this headset supports 6DoF positional tracking.

Value true if this headset supports 6DoF positional tracking, or false if only 3DoF rotation-based head tracking is supported.

Protected functions

GvrHeadset

 GvrHeadset()

Initializes a new instance of the GvrHeadset class.

Public functions

OnRecenterEvent

delegate void OnRecenterEvent(
  GvrRecenterEventType recenterType,
  GvrRecenterFlags recenterFlags,
  Vector3 recenteredPosition,
  Quaternion recenteredOrientation
)

This delegate is called after the headset is recentered.

Details
Parameters
recenterType
Indicates the reason recentering occurred.
recenterFlags
Flags related to recentering. See |GvrRecenterFlags|.
recenteredPosition
The positional offset from the session start pose.
recenteredOrientation
The rotational offset from the session start pose.

OnSafetyRegionEvent

delegate void OnSafetyRegionEvent(
  bool enter
)

This delegate is called when the headset crosses the safety region boundary.

Details
Parameters
enter
Set to true if the safety region is being entered, or false if the safety region is being exited.

Public static functions

TryGetFloorHeight

bool TryGetFloorHeight(
  ref float floorHeight
)

Populates floorHeight with the detected height, if one is available.

This may be unavailable if the underlying GVR API call fails.

Details
Parameters
floorHeight
If this call returns true, this value is set to the retrieved floorHeight. Otherwise leaves the value unchanged.
Returns
Returns true if value retrieval was successful, false otherwise (depends on tracking state).

TryGetRecenterTransform

bool TryGetRecenterTransform(
  ref Vector3 position,
  ref Quaternion rotation
)

Populates position and rotation with the last recenter transform, if one is available.

This may be unavailable if the underlying GVR API call fails.

Details
Parameters
position
If this call returns true, this value is set to the retrieved position.
rotation
If this call returns true, this value is set to the retrieved rotation.
Returns
Returns true if value retrieval was successful, false otherwise.

TryGetSafetyCylinderInnerRadius

bool TryGetSafetyCylinderInnerRadius(
  ref float innerRadius
)

Populates innerRadius with the safety cylinder inner radius, if one is available.

This is the radius at which safety management (e.g. safety fog) may cease taking effect.

If the safety region is of type GvrSafetyRegionType.Cylinder, populates innerRadius with the inner radius size of the safety cylinder in meters. Before using, confirm that the safety region type is GvrSafetyRegionType.Cylinder. This may be unavailable if the underlying GVR API call fails.

Details
Parameters
innerRadius
If this call returns true, this value is set to the retrieved innerRadius.
Returns
Returns true if value retrieval was successful, false otherwise.

TryGetSafetyCylinderOuterRadius

bool TryGetSafetyCylinderOuterRadius(
  ref float outerRadius
)

Populates outerRadius with the safety cylinder outer radius, if one is available.

If the safety region is of type GvrSafetyRegionType.Cylinder, populates outerRadius with the outer radius size of the safety cylinder in meters. Before using, confirm that the safety region type is GvrSafetyRegionType.Cylinder. This may be unavailable if the underlying GVR API call fails.

This is the radius at which safety management (e.g. safety fog) may start to take effect.

Details
Parameters
outerRadius
If this call returns true, this value is set to the retrieved outerRadius.
Returns
Returns true if value retrieval was successful, false otherwise.

TryGetSafetyRegionType

bool TryGetSafetyRegionType(
  ref GvrSafetyRegionType safetyType
)

Populates safetyType with the safety region type, if one is available.

Populates safetyType with the available safety region feature on the currently-running device. This may be unavailable if the underlying GVR API call fails.

Details
Parameters
safetyType
If this call returns true, this value is set to the retrieved safetyType.
Returns
Returns true if value retrieval was successful, false otherwise.