Tilt Five™ Unity API  1.4.1
TiltFive.GameBoard.GameboardExtents Struct Reference

Represents the distances from the gameboard tracking origin to the borders of the gameboard's viewable area. More...

Public Member Functions

 GameboardExtents (T5_GameboardSize gameboardSize)
 
Vector3 GetCornerPositionInGameboardSpace (Corner corner)
 Gets the coordinates of the specified corner in gameboard space. More...
 
Vector3 GetEdgeCenterPositionInGameboardSpace (Edge edge)
 Gets the coordinates of the center of the specified edge in gameboard space. More...
 
Vector3 GetPhysicalCenterPositionInGameboardSpace ()
 Gets the coordinates of the center of the gameboard in gameboard space. More...
 

Static Public Member Functions

static GameboardExtents ()
 

Public Attributes

Length ViewableExtentPositiveX
 The distance in meters from the gameboard origin to the edge of the viewable area in the positive X direction. More...
 
Length ViewableExtentNegativeX
 The distance in meters from the gameboard origin to the edge of the viewable area in the negative X direction. More...
 
Length ViewableExtentPositiveZ
 The distance in meters from the gameboard origin to the edge of the viewable area in the positive Z direction. More...
 
Length ViewableExtentNegativeZ
 The distance in meters from the gameboard origin to the edge of the viewable area in the negative Z direction. More...
 
Length ViewableExtentPositiveY
 The distance in meters above the gameboard origin that the viewable area extends in the positive Y direction. More...
 

Properties

Length ViewableSpanX [get]
 The distance in meters representing the side-to-side width of the viewable area of the gameboard; More...
 
Length ViewableSpanY [get]
 The distance in meters representing the front-to-back length of the viewable area of the gameboard; More...
 
Length ViewableSpanZ [get]
 The distance in meters representing the height of the viewable area of the gameboard; More...
 
Length OriginOffsetZ [get]
 The distance from the tracking origin to the physical center of the gameboard. More...
 

Detailed Description

Represents the distances from the gameboard tracking origin to the borders of the gameboard's viewable area.

Definition at line 169 of file GameBoard.cs.

Constructor & Destructor Documentation

◆ GameboardExtents() [1/2]

static TiltFive.GameBoard.GameboardExtents.GameboardExtents ( )
static

Definition at line 223 of file GameBoard.cs.

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  }

◆ GameboardExtents() [2/2]

TiltFive.GameBoard.GameboardExtents.GameboardExtents ( T5_GameboardSize  gameboardSize)

Definition at line 230 of file GameBoard.cs.

231  {
232  ViewableExtentPositiveX = new Length(gameboardSize.ViewableExtentPositiveX, LengthUnit.Meters);
233  ViewableExtentNegativeX = new Length(gameboardSize.ViewableExtentNegativeX, LengthUnit.Meters);
234  ViewableExtentPositiveZ = new Length(gameboardSize.ViewableExtentPositiveZ, LengthUnit.Meters);
235  ViewableExtentNegativeZ = new Length(gameboardSize.ViewableExtentNegativeZ, LengthUnit.Meters);
236  ViewableExtentPositiveY = new Length(gameboardSize.ViewableExtentPositiveY, LengthUnit.Meters);
237  }
LengthUnit
Definition: Length.cs:22
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
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 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

References TiltFive.T5_GameboardSize.ViewableExtentNegativeX, TiltFive.GameBoard.GameboardExtents.ViewableExtentNegativeX, TiltFive.T5_GameboardSize.ViewableExtentNegativeZ, TiltFive.GameBoard.GameboardExtents.ViewableExtentNegativeZ, TiltFive.T5_GameboardSize.ViewableExtentPositiveX, TiltFive.GameBoard.GameboardExtents.ViewableExtentPositiveX, TiltFive.T5_GameboardSize.ViewableExtentPositiveY, TiltFive.GameBoard.GameboardExtents.ViewableExtentPositiveY, TiltFive.T5_GameboardSize.ViewableExtentPositiveZ, and TiltFive.GameBoard.GameboardExtents.ViewableExtentPositiveZ.

Member Function Documentation

◆ GetCornerPositionInGameboardSpace()

Vector3 TiltFive.GameBoard.GameboardExtents.GetCornerPositionInGameboardSpace ( Corner  corner)

Gets the coordinates of the specified corner in gameboard space.

Parameters
corner
Returns
The coordinates of the specified corner in gameboard space.
Exceptions
ArgumentExceptionThrown when an invalid value for corner is provided.

Definition at line 245 of file GameBoard.cs.

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  }
Corner
Represents ordinal positions around the gameboard, relative to a user positioned at the near (default...
Definition: GameBoard.cs:136
float ToMeters
The Length, converted to meters.
Definition: Length.cs:94

References TiltFive.Length.ToMeters, TiltFive.GameBoard.GameboardExtents.ViewableExtentNegativeX, TiltFive.GameBoard.GameboardExtents.ViewableExtentNegativeZ, TiltFive.GameBoard.GameboardExtents.ViewableExtentPositiveX, and TiltFive.GameBoard.GameboardExtents.ViewableExtentPositiveZ.

◆ GetEdgeCenterPositionInGameboardSpace()

Vector3 TiltFive.GameBoard.GameboardExtents.GetEdgeCenterPositionInGameboardSpace ( Edge  edge)

Gets the coordinates of the center of the specified edge in gameboard space.

Parameters
edge
Returns
The coordinates of the center of the specified edge in gameboard space.
Exceptions
ArgumentExceptionThrown when an invalid value for edge is provided.

Definition at line 272 of file GameBoard.cs.

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  }
Edge
Represents cardinal positions around the gameboard (i.e. the centers of the edges of the gameboard),...
Definition: GameBoard.cs:107
Length OriginOffsetZ
The distance from the tracking origin to the physical center of the gameboard.
Definition: GameBoard.cs:216

References TiltFive.GameBoard.GameboardExtents.OriginOffsetZ, TiltFive.Length.ToMeters, TiltFive.GameBoard.GameboardExtents.ViewableExtentNegativeX, TiltFive.GameBoard.GameboardExtents.ViewableExtentNegativeZ, TiltFive.GameBoard.GameboardExtents.ViewableExtentPositiveX, and TiltFive.GameBoard.GameboardExtents.ViewableExtentPositiveZ.

◆ GetPhysicalCenterPositionInGameboardSpace()

Vector3 TiltFive.GameBoard.GameboardExtents.GetPhysicalCenterPositionInGameboardSpace ( )

Gets the coordinates of the center of the gameboard in gameboard space.

Returns

For the LE gameboard, the tracking origin and the center of the gameboard overlap, so this will return a vector of [0, 0, 0], but for the XE gameboard variants, the tracking origin is offset from the gameboard's physical center point, making function useful for accounting for this offset.

Definition at line 298 of file GameBoard.cs.

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  }

References TiltFive.GameBoard.GameboardExtents.OriginOffsetZ, and TiltFive.Length.ToMeters.

Member Data Documentation

◆ ViewableExtentNegativeX

Length TiltFive.GameBoard.GameboardExtents.ViewableExtentNegativeX

The distance in meters from the gameboard origin to the edge of the viewable area in the negative X direction.

Definition at line 179 of file GameBoard.cs.

Referenced by TiltFive.GameBoard.GameboardExtents.GameboardExtents(), TiltFive.GameBoard.GameboardExtents.GetCornerPositionInGameboardSpace(), and TiltFive.GameBoard.GameboardExtents.GetEdgeCenterPositionInGameboardSpace().

◆ ViewableExtentNegativeZ

Length TiltFive.GameBoard.GameboardExtents.ViewableExtentNegativeZ

The distance in meters from the gameboard origin to the edge of the viewable area in the negative Z direction.

Definition at line 189 of file GameBoard.cs.

Referenced by TiltFive.GameBoard.GameboardExtents.GameboardExtents(), TiltFive.GameBoard.GameboardExtents.GetCornerPositionInGameboardSpace(), and TiltFive.GameBoard.GameboardExtents.GetEdgeCenterPositionInGameboardSpace().

◆ ViewableExtentPositiveX

Length TiltFive.GameBoard.GameboardExtents.ViewableExtentPositiveX

The distance in meters from the gameboard origin to the edge of the viewable area in the positive X direction.

Definition at line 174 of file GameBoard.cs.

Referenced by TiltFive.GameBoard.GameboardExtents.GameboardExtents(), TiltFive.GameBoard.GameboardExtents.GetCornerPositionInGameboardSpace(), and TiltFive.GameBoard.GameboardExtents.GetEdgeCenterPositionInGameboardSpace().

◆ ViewableExtentPositiveY

Length TiltFive.GameBoard.GameboardExtents.ViewableExtentPositiveY

The distance in meters above the gameboard origin that the viewable area extends in the positive Y direction.

Definition at line 194 of file GameBoard.cs.

Referenced by TiltFive.GameBoard.GameboardExtents.GameboardExtents().

◆ ViewableExtentPositiveZ

Length TiltFive.GameBoard.GameboardExtents.ViewableExtentPositiveZ

The distance in meters from the gameboard origin to the edge of the viewable area in the positive Z direction.

Definition at line 184 of file GameBoard.cs.

Referenced by TiltFive.GameBoard.GameboardExtents.GameboardExtents(), TiltFive.GameBoard.GameboardExtents.GetCornerPositionInGameboardSpace(), and TiltFive.GameBoard.GameboardExtents.GetEdgeCenterPositionInGameboardSpace().

Property Documentation

◆ OriginOffsetZ

Length TiltFive.GameBoard.GameboardExtents.OriginOffsetZ
get

The distance from the tracking origin to the physical center of the gameboard.

For square configurations like the LE gameboard, this value will be zero, but this can be helpful for spatial logic relating to the XE or XE Raised gameboards.

Definition at line 216 of file GameBoard.cs.

Referenced by TiltFive.GameBoard.GameboardExtents.GetEdgeCenterPositionInGameboardSpace(), and TiltFive.GameBoard.GameboardExtents.GetPhysicalCenterPositionInGameboardSpace().

◆ ViewableSpanX

Length TiltFive.GameBoard.GameboardExtents.ViewableSpanX
get

The distance in meters representing the side-to-side width of the viewable area of the gameboard;

Definition at line 199 of file GameBoard.cs.

◆ ViewableSpanY

Length TiltFive.GameBoard.GameboardExtents.ViewableSpanY
get

The distance in meters representing the front-to-back length of the viewable area of the gameboard;

Definition at line 203 of file GameBoard.cs.

◆ ViewableSpanZ

Length TiltFive.GameBoard.GameboardExtents.ViewableSpanZ
get

The distance in meters representing the height of the viewable area of the gameboard;

Definition at line 207 of file GameBoard.cs.


The documentation for this struct was generated from the following file: