The Glasses API and runtime.
More...
|
static bool | IsTracked (PlayerIndex playerIndex=PlayerIndex.One) |
| Indicate if the specified glasses are tracked. More...
|
|
static bool | TryGetFriendlyName (PlayerIndex playerIndex, out string friendlyName) |
| Gets the friendly name associated with the specified player's glasses in the Tilt Five Control Panel. More...
|
|
static bool | TryGetPose (PlayerIndex playerIndex, out Pose pose) |
| Attempts to get the position and orientation of the specified player's glasses. More...
|
|
static bool | TryGetPreviewPose (PlayerIndex playerIndex, out Pose pose) |
| Attempts to get the position and orientation of the specified player's glasses, smoothed for on-screen preview. More...
|
|
static GameObject | GetPoseRoot (PlayerIndex playerIndex) |
| Gets the pose root GameObject for the specified player. More...
|
|
static Camera | GetLeftEye (PlayerIndex playerIndex) |
| Gets the left eye camera for the specified player's glasses. More...
|
|
static Camera | GetRightEye (PlayerIndex playerIndex) |
| Gets the right eye camera for the specified player's glasses. More...
|
|
static bool | headPoseUpdated (PlayerIndex playerIndex=PlayerIndex.One) |
| Returns a boolean indication that the head pose was successfully updated. More...
|
|
static void | Reset (GlassesSettings glassesSettings, SpectatorSettings spectatorSettings=null, PlayerIndex playerIndex=PlayerIndex.None) |
| Reset this T:TiltFive.Glasses. More...
|
|
static bool | Validate (GlassesSettings glassesSettings, SpectatorSettings spectatorSettings=null, PlayerIndex playerIndex=PlayerIndex.One) |
| Validates the specified glassesSettings with the specified glasses core. More...
|
|
static void | Update (GlassesSettings glassesSettings, ScaleSettings scaleSettings, GameBoardSettings gameBoardSettings) |
| Updates this T:TiltFive.Glasses. More...
|
|
static bool | IsConnected (PlayerIndex playerIndex=PlayerIndex.One) |
| Indicate if the specified glasses are connected. More...
|
|
static void | ScanForGlasses () |
|
|
static bool | updated [get] |
| Gets a value indicating whether this T:TiltFive.Glasses is updated. More...
|
|
static bool | configured [get] |
| Gets a value indicating whether this T:TiltFive.Glasses is configured. More...
|
|
static Vector3 | position [get] |
| Gets the head pose position. More...
|
|
static Quaternion | rotation [get] |
| Gets the head pose rotation. More...
|
|
static Vector3 | forward [get] |
| Gets the head orientation's forward vector. More...
|
|
static Vector3 | right [get] |
| Gets the head orientation's right vector. More...
|
|
static Vector3 | up [get] |
| Gets the head orientation's up vector. More...
|
|
static Vector3 | leftEyePosition [get] |
| Gets the left eye position. More...
|
|
static Vector3 | rightEyePosition [get] |
| Gets the right eye position. More...
|
|
static bool | glassesAvailable [get, private set] |
| Indicates whether the glasses are plugged in and functioning. More...
|
|
static T | Instance [get] |
|
The Glasses API and runtime.
Definition at line 34 of file Glasses.cs.
◆ AREyes
Enumerator |
---|
EYE_LEFT | |
EYE_RIGHT | |
EYE_MAX | |
Definition at line 56 of file Glasses.cs.
◆ GetLeftEye() [1/2]
static Camera TiltFive.Glasses.GetLeftEye |
( |
GlassesHandle |
glassesHandle | ) |
|
|
staticprivate |
Definition at line 638 of file Glasses.cs.
640 if (!
Instance.glassesCores.TryGetValue(glassesHandle, out var glassesCore))
644 return glassesCore.leftEye;
◆ GetLeftEye() [2/2]
static Camera TiltFive.Glasses.GetLeftEye |
( |
PlayerIndex |
playerIndex | ) |
|
|
static |
Gets the left eye camera for the specified player's glasses.
- Parameters
-
- Returns
- Returns
null
if the specified player is not connected.
Definition at line 268 of file Glasses.cs.
270 if (!
Player.TryGetGlassesHandle(playerIndex, out var glassesHandle))
static Camera GetLeftEye(PlayerIndex playerIndex)
Gets the left eye camera for the specified player's glasses.
Provides access to player settings and functionality.
Referenced by TiltFive.TiltFiveManager.GetEyeCamera(), and TiltFive.TiltFiveManager2.GetEyeCamera().
◆ GetPlayerOneGlassesCore()
static GlassesCore TiltFive.Glasses.GetPlayerOneGlassesCore |
( |
| ) |
|
|
staticprivate |
Definition at line 657 of file Glasses.cs.
660 &&
Instance.glassesCores.TryGetValue(glassesHandle, out var glassesCore))
PlayerIndex
The Player index (e.g. Player One, Player Two, etc)
◆ GetPoseRoot() [1/2]
static GameObject TiltFive.Glasses.GetPoseRoot |
( |
GlassesHandle |
glassesHandle | ) |
|
|
staticprivate |
Definition at line 629 of file Glasses.cs.
631 if (!
Instance.glassesCores.TryGetValue(glassesHandle, out var glassesCore))
635 return glassesCore.headPose.gameObject;
◆ GetPoseRoot() [2/2]
static GameObject TiltFive.Glasses.GetPoseRoot |
( |
PlayerIndex |
playerIndex | ) |
|
|
static |
Gets the pose root GameObject for the specified player.
This GameObject's pose is driven by the player's head position over the gameboard. Parented underneath this GameObject are the two eye cameras and an instance of the developer-provided prefab in the player's Glasses settings.
- Parameters
-
- Returns
- Returns
null
if the specified player is not connected.
Definition at line 254 of file Glasses.cs.
256 if(!
Player.TryGetGlassesHandle(playerIndex, out var glassesHandle))
static GameObject GetPoseRoot(PlayerIndex playerIndex)
Gets the pose root GameObject for the specified player.
Referenced by TiltFive.TiltFiveManager.Update(), and TiltFive.TiltFiveManager2.Update().
◆ GetRightEye() [1/2]
static Camera TiltFive.Glasses.GetRightEye |
( |
GlassesHandle |
glassesHandle | ) |
|
|
staticprivate |
Definition at line 647 of file Glasses.cs.
649 if (!
Instance.glassesCores.TryGetValue(glassesHandle, out var glassesCore))
654 return glassesCore.rightEye;
◆ GetRightEye() [2/2]
static Camera TiltFive.Glasses.GetRightEye |
( |
PlayerIndex |
playerIndex | ) |
|
|
static |
Gets the right eye camera for the specified player's glasses.
- Parameters
-
- Returns
- Returns
null
if the specified player is not connected.
Definition at line 282 of file Glasses.cs.
284 if (!
Player.TryGetGlassesHandle(playerIndex, out var glassesHandle))
static Camera GetRightEye(PlayerIndex playerIndex)
Gets the right eye camera for the specified player's glasses.
◆ headPoseUpdated()
Returns a boolean indication that the head pose was successfully updated.
- Returns
true
, if the head pose was updated, false
otherwise.
- Parameters
-
glassesHandle | The specified glasses. If null is provided, this uses the default glasses. |
Definition at line 300 of file Glasses.cs.
302 if (playerIndex ==
PlayerIndex.None || !
Player.TryGetGlassesHandle(playerIndex, out var glassesHandle))
307 return Instance.glassesCores.TryGetValue(glassesHandle, out var glassesCore)
308 && glassesCore.IsTracked;
References TiltFive.Singleton< Glasses >.Instance.
◆ IsConnected()
Indicate if the specified glasses are connected.
- Returns
true
if the glasses are connected, false
otherwise.
- Parameters
-
glassesHandle | Glasses handle to check. |
Definition at line 353 of file Glasses.cs.
355 return Player.TryGetGlassesHandle(playerIndex, out var glassesHandle)
static bool IsConnected(PlayerIndex playerIndex=PlayerIndex.One)
Indicate if the specified glasses are connected.
◆ IsTracked()
◆ Reset()
Reset this T:TiltFive.Glasses.
- Parameters
-
glassesSettings | Glasses settings for configuring the specified glassesCore. |
playerIndex | The specified player. If None is provided, this resets all glasses. |
Definition at line 317 of file Glasses.cs.
319 Reset(playerIndex, glassesSettings, spectatorSettings);
static void Reset(GlassesSettings glassesSettings, SpectatorSettings spectatorSettings=null, PlayerIndex playerIndex=PlayerIndex.None)
Reset this T:TiltFive.Glasses.
Referenced by TiltFive.TiltFiveManager.OnEnable().
◆ ScanForGlasses()
static void TiltFive.Glasses.ScanForGlasses |
( |
| ) |
|
|
static |
◆ TryGetFriendlyName()
static bool TiltFive.Glasses.TryGetFriendlyName |
( |
PlayerIndex |
playerIndex, |
|
|
out string |
friendlyName |
|
) |
| |
|
static |
Gets the friendly name associated with the specified player's glasses in the Tilt Five Control Panel.
- Parameters
-
- Returns
- Returns
false
and sets friendlyName to null if there was a problem getting the friendly name for this player; otherwise true. This can happen if the provided PlayerIndex is invalid, the player is not connected, or if the user hasn't yet set a friendly name for this particular set of glasses.
Definition at line 178 of file Glasses.cs.
180 if(!
Player.TryGetGlassesHandle(playerIndex, out var glassesHandle))
static bool TryGetFriendlyName(PlayerIndex playerIndex, out string friendlyName)
Gets the friendly name associated with the specified player's glasses in the Tilt Five Control Panel.
Referenced by TiltFive.Wand.WandCore.WandCore().
◆ TryGetPose()
static bool TiltFive.Glasses.TryGetPose |
( |
PlayerIndex |
playerIndex, |
|
|
out Pose |
pose |
|
) |
| |
|
static |
Attempts to get the position and orientation of the specified player's glasses.
- Parameters
-
- Returns
- Returns
false
along with an empty pose if something goes wrong.
Definition at line 215 of file Glasses.cs.
217 if(
Player.TryGetGlassesHandle(playerIndex, out var glassesHandle) &&
Instance.glassesCores.TryGetValue(glassesHandle, out var glassesCore))
219 pose = glassesCore.Pose_UnityWorldSpace;
References TiltFive.Singleton< Glasses >.Instance.
◆ TryGetPreviewPose()
static bool TiltFive.Glasses.TryGetPreviewPose |
( |
PlayerIndex |
playerIndex, |
|
|
out Pose |
pose |
|
) |
| |
|
static |
◆ TryGetSpectatorSettings()
static bool TiltFive.Glasses.TryGetSpectatorSettings |
( |
out SpectatorSettings |
spectatorSettings | ) |
|
|
staticprivate |
◆ Update()
◆ Validate()
Validates the specified glassesSettings with the specified glasses core.
- Returns
true
, if the glasses core is valid with the given settings, false
otherwise.
- Parameters
-
glassesSettings | Glasses settings. |
playerIndex | The specified glasses to validate. If None is provided, this uses the default glasses. |
Definition at line 332 of file Glasses.cs.
334 return Validate(playerIndex, glassesSettings, spectatorSettings);
static bool Validate(GlassesSettings glassesSettings, SpectatorSettings spectatorSettings=null, PlayerIndex playerIndex=PlayerIndex.One)
Validates the specified glassesSettings with the specified glasses core.
◆ defaultGlassesHandle
GlassesHandle? TiltFive.Glasses.defaultGlassesHandle |
|
private |
The identifier for the first detected pair of glasses.
Definition at line 49 of file Glasses.cs.
◆ glassesCores
Dictionary<GlassesHandle, GlassesCore> TiltFive.Glasses.glassesCores = new Dictionary<GlassesHandle, GlassesCore>() |
|
private |
The glasses core runtimes.
Definition at line 41 of file Glasses.cs.
◆ incomingHandles
HashSet<GlassesHandle> TiltFive.Glasses.incomingHandles = new HashSet<GlassesHandle>() |
|
private |
◆ lostHandles
HashSet<GlassesHandle> TiltFive.Glasses.lostHandles = new HashSet<GlassesHandle>() |
|
private |
◆ configured
bool TiltFive.Glasses.configured |
|
staticget |
Gets a value indicating whether this T:TiltFive.Glasses is configured.
true
if player 1's glasses are connected and they've been configured; otherwise, false
.
Definition at line 81 of file Glasses.cs.
◆ forward
Vector3 TiltFive.Glasses.forward |
|
staticget |
Gets the head orientation's forward vector.
The forward vector of player 1's glasses (if connected, otherwise the default forward vector)
Definition at line 99 of file Glasses.cs.
◆ glassesAvailable
bool TiltFive.Glasses.glassesAvailable |
|
staticgetprivate set |
Indicates whether the glasses are plugged in and functioning.
Definition at line 130 of file Glasses.cs.
130 {
get;
private set; }
◆ leftEyePosition
Vector3 TiltFive.Glasses.leftEyePosition |
|
staticget |
Gets the left eye position.
The left eye position of player 1's glasses (if connected, otherwise the zero vector)
Definition at line 118 of file Glasses.cs.
◆ position
Vector3 TiltFive.Glasses.position |
|
staticget |
Gets the head pose position.
The position of player 1's glasses (if connected, otherwise a zero vector)
Definition at line 87 of file Glasses.cs.
◆ right
Vector3 TiltFive.Glasses.right |
|
staticget |
Gets the head orientation's right vector.
The right vector of player 1's glasses (if connected, otherwise the default right vector)
Definition at line 105 of file Glasses.cs.
◆ rightEyePosition
Vector3 TiltFive.Glasses.rightEyePosition |
|
staticget |
Gets the right eye position.
The right eye position of player 1's glasses (if connected, otherwise the zero vector)
Definition at line 124 of file Glasses.cs.
◆ rotation
Quaternion TiltFive.Glasses.rotation |
|
staticget |
Gets the head pose rotation.
The rotation of player 1's glasses (if connected, otherwise the identity quaternion)
Definition at line 93 of file Glasses.cs.
◆ up
Vector3 TiltFive.Glasses.up |
|
staticget |
Gets the head orientation's up vector.
The up vector of player 1's glasses (if connected, otherwise the default up vector)
Definition at line 111 of file Glasses.cs.
◆ updated
bool TiltFive.Glasses.updated |
|
staticget |
Gets a value indicating whether this T:TiltFive.Glasses is updated.
true
if player 1's glasses are connected and their glasses pose has been updated; otherwise, false
.
Definition at line 74 of file Glasses.cs.
The documentation for this class was generated from the following file: