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.

This is a singleton object.

Inheritance

Inherits from: MonoBehaviour

Properties

OnRecenter
OnSafetyRegionChange
SupportsPositionalTracking
static bool
Returns |true| if the current headset supports positionally tracked, 6DOF head poses.

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
If a floor is found, populates floorHeight with the detected height.
TryGetRecenterTransform(ref Vector3 position, ref Quaternion rotation)
bool
If the last recentering transform is available, populates position and rotation with that transform.
TryGetSafetyCylinderInnerRadius(ref float innerRadius)
bool
If the safety region is of type GvrSafetyRegionType.Cylinder, populates innerRadius with the inner radius size (where fog starts appearing) of the safety cylinder in meters.
TryGetSafetyCylinderOuterRadius(ref float outerRadius)
bool
If the safety region is of type GvrSafetyRegionType.Cylinder, populates outerRadius with the outer radius size (where fog is 100% opaque) of the safety cylinder in meters.
TryGetSafetyRegionType(ref GvrSafetyRegionType safetyType)
bool
Populates safetyType with the available safety region feature on the currently-running device.

Properties

OnRecenter

static OnRecenterEvent OnRecenter

OnSafetyRegionChange

static OnSafetyRegionEvent OnSafetyRegionChange

SupportsPositionalTracking

static bool SupportsPositionalTracking

Returns |true| if the current headset supports positionally tracked, 6DOF head poses.

Returns |false| if only rotation-based head poses are supported.

Public functions

OnRecenterEvent

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

This delegate is called after the headset is recentered.

|recenterType| indicates the reason recentering occurred. |recenterFlags| are flags related to recentering. See |GvrRecenterFlags|. |recenteredPosition| is the positional offset from the session start pose. |recenteredOrientation| is 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.

Public static functions

TryGetFloorHeight

bool TryGetFloorHeight(
  ref float floorHeight
)

If a floor is found, populates floorHeight with the detected height.

Otherwise, leaves the value unchanged. Returns true if value retrieval was successful, false otherwise (depends on tracking state).

TryGetRecenterTransform

bool TryGetRecenterTransform(
  ref Vector3 position,
  ref Quaternion rotation
)

If the last recentering transform is available, populates position and rotation with that transform.

Returns true if value retrieval was successful, false otherwise (unlikely).

TryGetSafetyCylinderInnerRadius

bool TryGetSafetyCylinderInnerRadius(
  ref float innerRadius
)

If the safety region is of type GvrSafetyRegionType.Cylinder, populates innerRadius with the inner radius size (where fog starts appearing) of the safety cylinder in meters.

Assumes the safety region type has been previously checked by the caller. Returns true if value retrieval was successful, false otherwise (if region type is GvrSafetyRegionType.Invalid).

TryGetSafetyCylinderOuterRadius

bool TryGetSafetyCylinderOuterRadius(
  ref float outerRadius
)

If the safety region is of type GvrSafetyRegionType.Cylinder, populates outerRadius with the outer radius size (where fog is 100% opaque) of the safety cylinder in meters.

Assumes the safety region type has been previously checked by the caller. Returns true if value retrieval was successful, false otherwise (if region type is GvrSafetyRegionType.Invalid).

TryGetSafetyRegionType

bool TryGetSafetyRegionType(
  ref GvrSafetyRegionType safetyType
)

Populates safetyType with the available safety region feature on the currently-running device.

Returns true if value retrieval was successful, false otherwise (unlikely).