Tilt Five™ Unity API  1.3.0
 
Loading...
Searching...
No Matches
GlassesSettings.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using UnityEngine;
4
5namespace TiltFive
6{
11 [System.Serializable]
13 {
14 #region Constants
15
19 internal const uint MAX_SUPPORTED_GLASSES_COUNT = 4; // TODO: Expand this to 4
20
21 public const float MIN_FOV = 35f;
22 public const float MAX_FOV = 64f;
23 public const float DEFAULT_FOV = 48f;
24
25 // A default value will be returned by the client API if a custom IPD hasn't been set for
26 // the glasses starting in version 1.1.0+, which means this constant won't be needed. It
27 // is kept for compatibility with older releases.
28 public const float DEFAULT_IPD_UGBD = 0.059f;
29
30 // Enforce a near clip plane that keeps objects from getting too close to the user's head.
31 // TODO: Determine the threshold for discomfort (plus a small amount of margin) via usability testing.
32 public const float MIN_NEAR_CLIP_DISTANCE_IN_METERS = 0.1f;
33
34 public static readonly string DEFAULT_FRIENDLY_NAME = "Tilt Five Glasses";
35
36 #endregion
37
38
39#if UNITY_EDITOR
43 public bool tiltFiveXR = true;
44
45 public bool copyPlayerOneCameraTemplate = true;
46 public bool copyPlayerOneObjectTemplate = true;
47 public bool copyCloneCameraTemplateChildren = true;
48 public bool copyPlayerOneCullingMask = true;
49 public bool copyPlayerOneFOVToggle = true;
50 public bool copyPlayerOneFOV = true;
51 public bool copyPlayerOneNearClipPlane = true;
52 public bool copyPlayerOneFarClipPlane = true;
53#endif
57 [System.Obsolete("headPoseCamera is deprecated, and its functionality has been split between " +
58 "GlassesSettings.cameraTemplate (for instantiating eye cameras) " +
59 "and SpectatorSettings.spectatorCamera (for the onscreen preview).")]
60 public Camera headPoseCamera;
61
62 // TODO: make this the default name and get rid of headPoseCamera when we update API in
63 // 2.0.0. We want to hold off until then because changing this will clear every scene's
64 // TiltFiveManager reference to the preview/headpose camera, requiring a manual fix of the
65 // broken reference in every scene.
70 public Camera cameraTemplate {
71 #pragma warning disable 618 // this is for compatibility; disable obsolete warning
72 get { return headPoseCamera; }
73 set { headPoseCamera = value; }
74 #pragma warning restore 618
75 }
76
80 public GameObject objectTemplate;
81
86 public bool cloneCameraTemplateChildren = false;
87
91 public LayerMask cullingMask = ~0;
92
97
101 public float farClipPlane = 100f;
102
103 public bool overrideFOV = false;
104 public float customFOV = DEFAULT_FOV;
105 public float fieldOfView => overrideFOV
106 ? Mathf.Clamp(customFOV, MIN_FOV, MAX_FOV)
107 : DEFAULT_FOV;
108
110
111 public bool usePreviewPose = true;
112 public Transform previewPose;
113
115
116 internal GlassesSettings Copy()
117 {
118 return (GlassesSettings)MemberwiseClone();
119 }
120 }
121}
GlassesSettings encapsulates all configuration data used by the Glasses' tracking runtime to compute ...
Camera cameraTemplate
The camera used as a template for creating the eye cameras at runtime.
GlassesMirrorMode glassesMirrorMode
static readonly string DEFAULT_FRIENDLY_NAME
float farClipPlane
The far clip plane in physical space (meters), to adjust for content scale and gameboard size.
LayerMask cullingMask
The culling mask to be used by the eye cameras for this pair of glasses.
GameObject objectTemplate
The object used as a template for creating the base Game Object when a pair of glasses connects.
float nearClipPlane
The near clip plane in physical space (meters), to adjust for content scale and gameboard size.
const float MIN_NEAR_CLIP_DISTANCE_IN_METERS
Camera headPoseCamera
The main camera used for rendering the Scene when the glasses are unavailable, and the gameobject use...
bool cloneCameraTemplateChildren
Whether or not the camera template's child gameobjects should be cloned during eye camera instantiati...
Definition: Log.cs:21