Stay organized with collections Save and categorize content based on your preferences.
GvrHeadsetMain entry point for Standalone headset APIs.
SummaryTo use this API, use the GvrHeadset prefab. There can be only one such prefab in a scene, since this is a singleton object.
InheritanceInherits from: MonoBehaviour
Direct Known Subclasses:
GoogleVR.Beta.GvrBetaHeadset Public functionsOnRecenterEvent(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 functionsTryGetFloorHeight(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.
static OnRecenterEvent OnRecenter
Event handlers for OnRecenter
.
Triggered when a recenter command has been issued by the user.
OnSafetyRegionChangestatic OnSafetyRegionEvent OnSafetyRegionChange
Event handlers for OnSafetyRegionChange
.
Triggered when the safety region has been entered or exited.
ProvidesEditorEmulatorbool ProvidesEditorEmulator
Gets a value indicating whether this headset provides an Editor Emulator.
Value true
if this headset provides an Editor Emulator, or false
otherwise.
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.
GvrHeadset()
Initializes a new instance of the GvrHeadset class.
Public functions OnRecenterEventdelegate void OnRecenterEvent( GvrRecenterEventType recenterType, GvrRecenterFlags recenterFlags, Vector3 recenteredPosition, Quaternion recenteredOrientation )
This delegate is called after the headset is recentered.
Details ParametersrecenterType
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.
OnSafetyRegionEventdelegate void OnSafetyRegionEvent( bool enter )
This delegate is called when the headset crosses the safety region boundary.
Details Parametersenter
Set to true
if the safety region is being entered, or false
if the safety region is being exited.
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 ParametersfloorHeight
If this call returns true
, this value is set to the retrieved floorHeight
. Otherwise leaves the value unchanged.
Returns true
if value retrieval was successful, false
otherwise (depends on tracking state).
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 Parametersposition
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 true
if value retrieval was successful, false
otherwise.
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.
innerRadius
If this call returns true
, this value is set to the retrieved innerRadius
.
Returns true
if value retrieval was successful, false
otherwise.
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 ParametersouterRadius
If this call returns true
, this value is set to the retrieved outerRadius
.
Returns true
if value retrieval was successful, false
otherwise.
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.
safetyType
If this call returns true
, this value is set to the retrieved safetyType
.
Returns true
if value retrieval was successful, false
otherwise.
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-09 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-09 UTC."],[[["`GvrHeadset` is the primary entry point for Standalone headset APIs and should be used as a prefab within a Unity scene."],["It provides access to headset features like positional tracking, recentering, and safety regions."],["Developers can leverage events like `OnRecenter` and `OnSafetyRegionChange` to respond to user interactions and safety boundaries."],["Static functions such as `TryGetFloorHeight` and `TryGetSafetyCylinderInnerRadius` allow retrieval of headset-specific data."],["Only one `GvrHeadset` prefab is permitted in a scene due to its singleton nature."]]],["The `GvrHeadset` API, a singleton object, is the main entry point for standalone headset APIs. Key actions include handling `OnRecenter` and `OnSafetyRegionChange` events. It supports querying positional tracking via `SupportsPositionalTracking` and provides an editor emulator. It provides public static functions to retrieve the floor height (`TryGetFloorHeight`), recenter transform (`TryGetRecenterTransform`), and safety cylinder radii (`TryGetSafetyCylinderInnerRadius`, `TryGetSafetyCylinderOuterRadius`), and region type (`TryGetSafetyRegionType`). This API also defines delegates for recentering and safety region events.\n"]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4