Tilt Five™ Unity API  1.4.1
GameBoard.cs
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020-2023 Tilt Five, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 using System;
18 using System.Collections.Generic;
19 using UnityEngine;
20 using TiltFive.Logging;
21 
22 namespace TiltFive
23 {
27  [ExecuteInEditMode]
29  {
30  #region Public Fields
31 
35  [Tooltip("Show/Hide the Board Gizmo in the Editor.")]
36  public bool ShowGizmo;
37 
38  [Tooltip("Show/Hide the Unit Grid on the Board Gizmo in the Editor.")]
39  public bool ShowGrid;
40 
41  public float GridHeightOffset = 0f;
42  public bool StickyHeightOffset = true;
43 
44 
48  [Tooltip("Sets the Alpha transparency of the Board Gizmo in the Editor.")]
49  [Range(0f, 1f)]
50  public float GizmoOpacity = 0.75f;
51 
55  [HideInInspector]
56  [Obsolete("Please use Gameboard.TryGetGameboardType() instead.")]
58 
59  #endregion Public Fields
60 
61 
62  #region Private Fields
63 
64 #if UNITY_EDITOR
65 
69  private TableTopGizmo boardGizmo = new TableTopGizmo();
70 
74  private float gridOffsetY => StickyHeightOffset ? Mathf.RoundToInt(GridHeightOffset) : GridHeightOffset;
75 
79  private LengthUnit currentContentScaleUnit;
80 
84  private float currentContentScaleRatio;
85 
89  private Vector3 currentScale;
90 
91  private const float MIN_SCALE = 0.00001f;
92 
93 #endif // UNITY_EDITOR
94 
95  private static Dictionary<PlayerIndex, GameboardType> playerGameboards = new Dictionary<PlayerIndex, GameboardType>();
96 
97  #endregion Private Fields
98 
99 
100  #region Public Enums
101 
106  public enum Edge
107  {
112  Near,
117  Far,
123  Left,
129  Right
130  }
131 
135  public enum Corner
136  {
137  FarLeft,
138  FarRight,
139  NearLeft,
140  NearRight
141  }
142 
143  #endregion Public Enums
144 
145 
146  #region Public Structs
147 
148  [Obsolete("GameboardDimensions is obsolete, please use GameboardExtents instead.")]
149  public struct GameboardDimensions
150  {
156 
157  public GameboardDimensions(T5_GameboardSize gameboardSize)
158  {
159  var gameboardExtents = new GameboardExtents(gameboardSize);
160  playableSpaceX = gameboardExtents.ViewableSpanX;
161  playableSpaceY = gameboardExtents.ViewableSpanZ;
162  borderWidth = new Length(GameboardExtents.BORDER_WIDTH_IN_METERS, LengthUnit.Meters);
163  }
164  }
165 
169  public struct GameboardExtents
170  {
175 
180 
185 
190 
195 
208 
217 
218  internal const float BORDER_WIDTH_IN_METERS = 0.05f;
219  internal static readonly T5_GameboardSize GAMEBOARD_SIZE_LE;
220  internal static readonly T5_GameboardSize GAMEBOARD_SIZE_XE;
221  internal static readonly T5_GameboardSize GAMEBOARD_SIZE_XE_RAISED;
222 
224  {
225  GAMEBOARD_SIZE_LE = new T5_GameboardSize(0.35f, 0.35f, 0.35f, 0.35f, 0f);
226  GAMEBOARD_SIZE_XE = new T5_GameboardSize(0.35f, 0.35f, 0.61667f, 0.35f, 0.0f);
227  GAMEBOARD_SIZE_XE_RAISED = new T5_GameboardSize(0.35f, 0.35f, 0.55944f, 0.35f, 0.20944f);
228  }
229 
230  public GameboardExtents(T5_GameboardSize gameboardSize)
231  {
237  }
238 
246  {
247  switch (corner)
248  {
249  case Corner.FarLeft:
250  return Vector3.forward * ViewableExtentPositiveZ.ToMeters
251  + Vector3.left * ViewableExtentNegativeX.ToMeters;
252  case Corner.FarRight:
253  return Vector3.forward * ViewableExtentPositiveZ.ToMeters
254  + Vector3.right * ViewableExtentPositiveX.ToMeters;
255  case Corner.NearLeft:
256  return Vector3.back * ViewableExtentNegativeZ.ToMeters
257  + Vector3.left * ViewableExtentNegativeX.ToMeters;
258  case Corner.NearRight:
259  return Vector3.back * ViewableExtentNegativeZ.ToMeters
260  + Vector3.right * ViewableExtentPositiveX.ToMeters;
261  default:
262  throw new System.ArgumentException("Cannot get corner positions for invalid Corner enum values.");
263  }
264  }
265 
273  {
274  switch (edge)
275  {
276  case Edge.Left:
277  return Vector3.left * ViewableExtentNegativeX.ToMeters
278  + Vector3.forward * OriginOffsetZ.ToMeters;
279  case Edge.Right:
280  return Vector3.right * ViewableExtentPositiveX.ToMeters
281  + Vector3.forward * OriginOffsetZ.ToMeters;
282  case Edge.Near:
283  return Vector3.back * ViewableExtentNegativeZ.ToMeters;
284  case Edge.Far:
285  return Vector3.forward * ViewableExtentPositiveZ.ToMeters;
286  default:
287  throw new System.ArgumentException("Cannot get edge center positions for invalid Edge enum values.");
288  }
289  }
290 
299  {
300  // If we ever have some funky gameboard in the future with a double-eccentric tracking origin,
301  // we'd just need to add another vector along the X axis (e.g. Vector3.right * OriginOffsetX.ToMeters)
302  return Vector3.forward * OriginOffsetZ.ToMeters;
303  }
304  }
305 
306  #endregion Private Structs
307 
308 
309  #region Public Functions
310 
318  public static bool TryGetGameboardType(out GameboardType gameboardType)
319  {
320  return TryGetGameboardType(PlayerIndex.One, out gameboardType);
321  }
322 
323  public static bool TryGetGameboardType(PlayerIndex playerIndex, out GameboardType gameboardType)
324  {
325  // Return false and a default gameboard if the player is nonexistent or disconnected.
326  if(!Player.TryGetGlassesHandle(playerIndex, out var glassesHandle)
327  || !playerGameboards.TryGetValue(playerIndex, out var currentGameboardType))
328  {
329  gameboardType = GameboardType.GameboardType_None;
330  return false;
331  }
332 
333  gameboardType = currentGameboardType;
334  return true;
335  }
336 
343  [Obsolete("TryGetGameboardDimensions is obsolete. Please use TryGetGameboardExtents instead.")]
344  public static bool TryGetGameboardDimensions(GameboardType gameboardType, out GameboardDimensions gameboardDimensions)
345  {
346  if(gameboardType == GameboardType.GameboardType_None)
347  {
348  gameboardDimensions = new GameboardDimensions();
349  return false;
350  }
351 
352  // Default to the LE gameboard dimensions in meters.
353  T5_GameboardSize gameboardSize = GameboardExtents.GAMEBOARD_SIZE_LE;
354  int result = NativePlugin.T5_RESULT_UNKNOWN_ERROR;
355 
356  try
357  {
358  result = NativePlugin.GetGameboardDimensions(gameboardType, ref gameboardSize);
359  }
360  catch (Exception e)
361  {
362  Log.Error(e.Message);
363  }
364 
365  gameboardDimensions = new GameboardDimensions(gameboardSize);
366 
367  return result == NativePlugin.T5_RESULT_SUCCESS;
368  }
369 
377  public static bool TryGetGameboardExtents(GameboardType gameboardType, out GameboardExtents gameboardExtents)
378  {
379  if(gameboardType == GameboardType.GameboardType_None)
380  {
381  gameboardExtents = new GameboardExtents();
382  return false;
383  }
384 
385  T5_GameboardSize gameboardSize = new T5_GameboardSize();
386  int result = NativePlugin.T5_RESULT_UNKNOWN_ERROR;
387 
388  try
389  {
390  result = NativePlugin.GetGameboardDimensions(gameboardType, ref gameboardSize);
391  }
392  catch (Exception e)
393  {
394  Log.Error(e.Message);
395  }
396 
397  gameboardExtents = new GameboardExtents(gameboardSize);
398 
399  return result == NativePlugin.T5_RESULT_SUCCESS;
400  }
401 
414  public bool TransformPose(Vector3 positionInGameboardSpace, Quaternion rotationToGameboardSpace, PlayerIndex playerIndex,
415  out Vector3 positionInWorldSpace, out Quaternion rotationToWorldSpace)
416  {
417  if (!Player.TryGetSettings(playerIndex, out var playerSettings))
418  {
419  positionInWorldSpace = Vector3.zero;
420  rotationToWorldSpace = Quaternion.identity;
421  return false;
422  }
423 
424  TransformPose(positionInGameboardSpace, rotationToGameboardSpace, playerSettings.scaleSettings,
425  out positionInWorldSpace, out rotationToWorldSpace);
426  return true;
427  }
428 
439  public bool TransformPose(Pose poseInGameboardSpace, PlayerIndex playerIndex, out Pose poseInWorldSpace)
440  {
441  if (!Player.TryGetSettings(playerIndex, out var playerSettings))
442  {
443  poseInWorldSpace = new Pose();
444  return false;
445  }
446 
447  poseInWorldSpace = TransformPose(poseInGameboardSpace, playerSettings.scaleSettings);
448  return true;
449  }
450 
461  public bool TransformPoint(Vector3 pointInGameboardSpace, PlayerIndex playerIndex, out Vector3 pointInWorldSpace)
462  {
463  if (!Player.TryGetSettings(playerIndex, out var playerSettings))
464  {
465  pointInWorldSpace = Vector3.zero;
466  return false;
467  }
468 
469  pointInWorldSpace = TransformPoint(pointInGameboardSpace, playerSettings.scaleSettings);
470  return true;
471  }
472 
485  public bool InverseTransformPose(Vector3 positionInWorldSpace, Quaternion rotationToWorldSpace, PlayerIndex playerIndex,
486  out Vector3 positionInGameboardSpace, out Quaternion rotationToGameboardSpace)
487  {
488  if (!Player.TryGetSettings(playerIndex, out var playerSettings))
489  {
490  positionInGameboardSpace = Vector3.zero;
491  rotationToGameboardSpace = Quaternion.identity;
492  return false;
493  }
494 
495  InverseTransformPose(positionInWorldSpace, rotationToWorldSpace, playerSettings.scaleSettings,
496  out positionInGameboardSpace, out rotationToGameboardSpace);
497  return true;
498  }
499 
510  public bool InverseTransformPose(Pose poseInWorldSpace, PlayerIndex playerIndex, out Pose poseInGameboardSpace)
511  {
512  if (!Player.TryGetSettings(playerIndex, out var playerSettings))
513  {
514  poseInGameboardSpace = new Pose();
515  return false;
516  }
517 
518  poseInGameboardSpace = InverseTransformPose(poseInWorldSpace, playerSettings.scaleSettings);
519  return true;
520  }
521 
532  public bool InverseTransformPoint(Vector3 pointInWorldSpace, PlayerIndex playerIndex, out Vector3 pointInGameboardSpace)
533  {
534  if (!Player.TryGetSettings(playerIndex, out var playerSettings))
535  {
536  pointInGameboardSpace = Vector3.zero;
537  return false;
538  }
539 
540  pointInGameboardSpace = InverseTransformPoint(pointInWorldSpace, playerSettings.scaleSettings);
541  return true;
542  }
543 
544 #if UNITY_EDITOR
545 
546  new public void Awake()
547  {
548  base.Awake();
549  currentScale = transform.localScale;
550  }
551 
555  public void DrawGizmo(ScaleSettings scaleSettings, GameBoardSettings gameBoardSettings)
556  {
557  UnifyScale();
558 
559  if (ShowGizmo)
560  {
561  boardGizmo.Draw(scaleSettings, gameBoardSettings, GizmoOpacity, ShowGrid, gridOffsetY);
562  }
563 
564  var sceneViewRepaintNecessary = ScaleCompensate(scaleSettings);
565  sceneViewRepaintNecessary |= ContentScaleCompensate(scaleSettings);
566 
567  if(sceneViewRepaintNecessary)
568  {
569  boardGizmo.ResetGrid(scaleSettings, gameBoardSettings); // This may need to change once separate game board configs are in.
570  UnityEditor.SceneView.lastActiveSceneView.Repaint();
571  }
572  }
573 
579  public GameboardType GetDisplayedGameboardType(GameBoardSettings gameBoardSettings)
580  {
581  return GetDisplayedGameboardType(PlayerIndex.One, gameBoardSettings);
582  }
583 
584  public static GameboardType GetDisplayedGameboardType(PlayerIndex playerIndex, GameBoardSettings gameBoardSettings)
585  {
586  if(playerIndex == PlayerIndex.None)
587  {
588  return GameboardType.GameboardType_None;
589  }
590 
591  var displayedGameboardType = playerGameboards.TryGetValue(playerIndex, out var gameboardType)
592  ? gameboardType
593  : GameboardType.GameboardType_LE;
594 
595  displayedGameboardType = gameBoardSettings.gameboardTypeOverride != GameboardType.GameboardType_None
596  ? gameBoardSettings.gameboardTypeOverride
597  : displayedGameboardType;
598 
599  return displayedGameboardType;
600  }
601 
602 #endif // UNITY_EDITOR
603 
604  #endregion Public Functions
605 
606 
607  #region Internal Functions
608 
609  internal static void SetGameboardType(PlayerIndex playerIndex, GameboardType gameboardType)
610  {
611  if(playerIndex == PlayerIndex.None)
612  {
613  return;
614  }
615 
616  playerGameboards[playerIndex] = gameboardType;
617  }
618 
619  internal static void SetGameboardType(GlassesHandle glassesHandle, GameboardType gameboardType)
620  {
621  if (Player.TryGetPlayerIndex(glassesHandle, out var playerIndex))
622  {
623  SetGameboardType(playerIndex, gameboardType);
624  }
625  }
626 
634  internal Pose TransformPose(Pose poseInGameboardSpace, ScaleSettings scaleSettings)
635  {
636  TransformPose(poseInGameboardSpace.position, poseInGameboardSpace.rotation, scaleSettings,
637  out var posUWRLD, out var rotToUWRLD_OBJ);
638  return new Pose(posUWRLD, rotToUWRLD_OBJ);
639  }
640 
650  internal void TransformPose(Vector3 positionInGameboardSpace, Quaternion rotationToGameboardSpace, ScaleSettings scaleSettings,
651  out Vector3 positionInWorldSpace, out Quaternion rotationToWorldSpace)
652  {
653  positionInWorldSpace = TransformPoint(positionInGameboardSpace, scaleSettings);
654 
655  // The rotation from gameboard space to world space
656  var rotToUWRLD_UGBD = transform.rotation;
657 
658  // The rotation from the object's local space to gameboard space
659  var rotToUGBD_OBJ = rotationToGameboardSpace;
660 
661  // The rotation from the object's local space to world space
662  var rotToUWRLD_OBJ = rotToUWRLD_UGBD * rotToUGBD_OBJ;
663 
664  rotationToWorldSpace = rotToUWRLD_OBJ;
665  }
666 
674  internal Vector3 TransformPoint(Vector3 pointInGameboardSpace, ScaleSettings scaleSettings)
675  {
676  var pos_UGBD = pointInGameboardSpace;
677 
678  var scaleToUWRLD_UGBD = scaleSettings.GetScaleToUWRLD_UGBD(localScale);
679  var rotToUWRLD_UGBD = transform.rotation;
680  var pos_UWRLD = rotToUWRLD_UGBD * (scaleToUWRLD_UGBD * pos_UGBD) + transform.position;
681 
682  return pos_UWRLD;
683  }
684 
692  internal Pose InverseTransformPose(Pose poseInWorldSpace, ScaleSettings scaleSettings)
693  {
694  InverseTransformPose(poseInWorldSpace.position, poseInWorldSpace.rotation, scaleSettings,
695  out var posUGBD, out var rotToUGBD_OBJ);
696  return new Pose(posUGBD, rotToUGBD_OBJ);
697  }
698 
708  internal void InverseTransformPose(Vector3 positionInWorldSpace, Quaternion rotationToWorldSpace, ScaleSettings scaleSettings,
709  out Vector3 positionInGameboardSpace, out Quaternion rotationToGameboardSpace)
710  {
711  positionInGameboardSpace = InverseTransformPoint(positionInWorldSpace, scaleSettings);
712 
713  // The rotation from gameboard space to world space
714  var rotToUWRLD_UGBD = transform.rotation;
715 
716  // The rotation from world space to gameboard space
717  var rotToUGBD_UWRLD = Quaternion.Inverse(rotToUWRLD_UGBD);
718 
719  // The rotation from the object's local space to world space
720  var rotToUWRLD_OBJ = rotationToWorldSpace;
721 
722  // The rotation from the object's local space to gameboard space
723  var rotToUGBD_OBJ = rotToUGBD_UWRLD * rotToUWRLD_OBJ;
724 
725  rotationToGameboardSpace = rotToUGBD_OBJ;
726  }
727 
735  internal Vector3 InverseTransformPoint(Vector3 pointInWorldSpace, ScaleSettings scaleSettings)
736  {
737  var pos_UWRLD = pointInWorldSpace;
738 
739  var scaleToUGBD_UWRLD = 1f / scaleSettings.GetScaleToUWRLD_UGBD(localScale);
740  var rotToUGBD_UWRLD = Quaternion.Inverse(transform.rotation);
741  var pos_UGBD = pos_UWRLD - transform.position;
742  pos_UGBD = rotToUGBD_UWRLD * pos_UGBD;
743  pos_UGBD *= scaleToUGBD_UWRLD;
744 
745  return pos_UGBD;
746  }
747 
748  #endregion
749 
750 
751  #region Private Functions
752 
753 #if UNITY_EDITOR
754 
761  private bool ScaleCompensate(ScaleSettings scaleSettings)
762  {
763  if(currentScale == transform.localScale) { return false; }
764 
765  // Prevent negative scale values for the game board.
766  if( transform.localScale.x < MIN_SCALE)
767  {
768  transform.localScale = Vector3.one * MIN_SCALE;
769  }
770 
771  //var sceneView = UnityEditor.SceneView.lastActiveSceneView;
772 
773  //sceneView.Frame(new Bounds(transform.position, (1/5f) * Vector3.one * scaleSettings.worldSpaceUnitsPerPhysicalMeter / localScale ), true);
774 
775  currentScale = transform.localScale;
776  return true;
777  }
778 
782  private bool ContentScaleCompensate(ScaleSettings scaleSettings)
783  {
784  if(currentContentScaleRatio == scaleSettings.contentScaleRatio
785  && currentContentScaleUnit == scaleSettings.contentScaleUnit) { return false; }
786 
787  //var sceneView = UnityEditor.SceneView.lastActiveSceneView;
788 
789  currentContentScaleUnit = scaleSettings.contentScaleUnit;
790  currentContentScaleRatio = scaleSettings.contentScaleRatio;
791 
792  //sceneView.Frame(new Bounds(transform.position, (1/5f) * Vector3.one * scaleSettings.worldSpaceUnitsPerPhysicalMeter / localScale ), true);
793 
794  return true;
795  }
796 
797 
798 #endif // UNITY_EDITOR
799 
800  #endregion Private Functions
801  }
802 }
Represents the game board.
Definition: GameBoard.cs:29
bool TransformPoint(Vector3 pointInGameboardSpace, PlayerIndex playerIndex, out Vector3 pointInWorldSpace)
Transforms the provided position from gameboard space to world space.
Definition: GameBoard.cs:461
static bool TryGetGameboardExtents(GameboardType gameboardType, out GameboardExtents gameboardExtents)
Attempts to obtain the physical dimensions for a particular gameboard type.
Definition: GameBoard.cs:377
static bool TryGetGameboardDimensions(GameboardType gameboardType, out GameboardDimensions gameboardDimensions)
Attempts to obtain the physical dimensions for a particular gameboard type.
Definition: GameBoard.cs:344
Edge
Represents cardinal positions around the gameboard (i.e. the centers of the edges of the gameboard),...
Definition: GameBoard.cs:107
bool ShowGizmo
Shows the game board gizmo in the editor.
Definition: GameBoard.cs:36
static Dictionary< PlayerIndex, GameboardType > playerGameboards
Definition: GameBoard.cs:95
static bool TryGetGameboardType(out GameboardType gameboardType)
Attempts to check the latest glasses pose for the current gameboard type, such as LE,...
Definition: GameBoard.cs:318
bool InverseTransformPoint(Vector3 pointInWorldSpace, PlayerIndex playerIndex, out Vector3 pointInGameboardSpace)
Transforms the provided position from world space to gameboard space.
Definition: GameBoard.cs:532
bool InverseTransformPose(Pose poseInWorldSpace, PlayerIndex playerIndex, out Pose poseInGameboardSpace)
Transforms the provided pose from world space to gameboard space.
Definition: GameBoard.cs:510
static bool TryGetGameboardType(PlayerIndex playerIndex, out GameboardType gameboardType)
Definition: GameBoard.cs:323
bool StickyHeightOffset
Definition: GameBoard.cs:42
float GizmoOpacity
Sets the opacity of the game board gizmo in the editor.
Definition: GameBoard.cs:50
bool TransformPose(Pose poseInGameboardSpace, PlayerIndex playerIndex, out Pose poseInWorldSpace)
Transforms the provided pose from gameboard space to world space.
Definition: GameBoard.cs:439
Corner
Represents ordinal positions around the gameboard, relative to a user positioned at the near (default...
Definition: GameBoard.cs:136
bool TransformPose(Vector3 positionInGameboardSpace, Quaternion rotationToGameboardSpace, PlayerIndex playerIndex, out Vector3 positionInWorldSpace, out Quaternion rotationToWorldSpace)
Transforms the provided pose from gameboard space to world space.
Definition: GameBoard.cs:414
float GridHeightOffset
Definition: GameBoard.cs:41
bool InverseTransformPose(Vector3 positionInWorldSpace, Quaternion rotationToWorldSpace, PlayerIndex playerIndex, out Vector3 positionInGameboardSpace, out Quaternion rotationToGameboardSpace)
Transforms the provided pose from world space to gameboard space.
Definition: GameBoard.cs:485
GameboardType GameboardType
The gameboard configuration, such as LE, XE, or folded XE.
Definition: GameBoard.cs:57
The Logger.
Definition: Log.cs:42
static void Error(string m, params object[] list)
ERROR logging function call.
Definition: Log.cs:127
Provides access to player settings and functionality.
Definition: Player.cs:31
static bool TryGetSettings(PlayerIndex playerIndex, out PlayerSettings playerSettings)
Obtains the PlayerSettings corresponding to the specified player.
Definition: Player.cs:79
Enforces uniform scaling by setting the x, y, and z scale components of the associated transform to b...
float localScale
The size of the object as a single float value, rather than a scale vector.
void UnifyScale()
Synchronizes the component values of the game object's local scale vector (e.g. [1,...
Definition: Log.cs:21
@ Right
The wand held in the player's right hand.
@ Left
The wand held in the player's left hand.
LengthUnit
Definition: Length.cs:22
GameboardType
The type of Gameboard being tracked by the glasses
PlayerIndex
The Player index (e.g. Player One, Player Two, etc)
GameboardDimensions(T5_GameboardSize gameboardSize)
Definition: GameBoard.cs:157
Represents the distances from the gameboard tracking origin to the borders of the gameboard's viewabl...
Definition: GameBoard.cs:170
Length ViewableSpanX
The distance in meters representing the side-to-side width of the viewable area of the gameboard;
Definition: GameBoard.cs:199
Length ViewableExtentNegativeZ
The distance in meters from the gameboard origin to the edge of the viewable area in the negative Z d...
Definition: GameBoard.cs:189
Vector3 GetCornerPositionInGameboardSpace(Corner corner)
Gets the coordinates of the specified corner in gameboard space.
Definition: GameBoard.cs:245
Length ViewableExtentPositiveZ
The distance in meters from the gameboard origin to the edge of the viewable area in the positive Z d...
Definition: GameBoard.cs:184
Length ViewableExtentPositiveY
The distance in meters above the gameboard origin that the viewable area extends in the positive Y di...
Definition: GameBoard.cs:194
Length ViewableExtentNegativeX
The distance in meters from the gameboard origin to the edge of the viewable area in the negative X d...
Definition: GameBoard.cs:179
Length ViewableSpanZ
The distance in meters representing the height of the viewable area of the gameboard;
Definition: GameBoard.cs:207
GameboardExtents(T5_GameboardSize gameboardSize)
Definition: GameBoard.cs:230
Vector3 GetEdgeCenterPositionInGameboardSpace(Edge edge)
Gets the coordinates of the center of the specified edge in gameboard space.
Definition: GameBoard.cs:272
Length ViewableSpanY
The distance in meters representing the front-to-back length of the viewable area of the gameboard;
Definition: GameBoard.cs:203
Length OriginOffsetZ
The distance from the tracking origin to the physical center of the gameboard.
Definition: GameBoard.cs:216
Length ViewableExtentPositiveX
The distance in meters from the gameboard origin to the edge of the viewable area in the positive X d...
Definition: GameBoard.cs:174
Vector3 GetPhysicalCenterPositionInGameboardSpace()
Gets the coordinates of the center of the gameboard in gameboard space.
Definition: GameBoard.cs:298
float ToMeters
The Length, converted to meters.
Definition: Length.cs:94
Physical dimensions of a gameboard, in meters.
float ViewableExtentNegativeX
The distance in meters from the gameboard origin to the edge of the viewable area in the negative X d...
float ViewableExtentPositiveY
The distance in meters above the gameboard origin that the viewable area extends in the positive Y di...
float ViewableExtentPositiveX
The distance in meters from the gameboard origin to the edge of the viewable area in the positive X d...
float ViewableExtentPositiveZ
The distance in meters from the gameboard origin to the edge of the viewable area in the positive Z d...
float ViewableExtentNegativeZ
The distance in meters from the gameboard origin to the edge of the viewable area in the negative Z d...