// Base Boundaries|SDK_Base|007
namespace VRTK
{
using UnityEngine;
///
/// The Base Boundaries SDK script provides a bridge to SDK methods that deal with the play area of SDKs that support room scale play spaces.
///
///
/// This is an abstract class to implement the interface required by all implemented SDKs.
///
public abstract class SDK_BaseBoundaries : SDK_Base
{
protected Transform cachedPlayArea;
///
/// The InitBoundaries method is run on start of scene and can be used to initialse anything on game start.
///
public abstract void InitBoundaries();
///
/// The GetPlayArea method returns the Transform of the object that is used to represent the play area in the scene.
///
/// A transform of the object representing the play area in the scene.
public abstract Transform GetPlayArea();
///
/// The GetPlayAreaVertices method returns the points of the play area boundaries.
///
/// A Vector3 array of the points in the scene that represent the play area boundaries.
public abstract Vector3[] GetPlayAreaVertices();
///
/// The GetPlayAreaBorderThickness returns the thickness of the drawn border for the given play area.
///
/// The thickness of the drawn border.
public abstract float GetPlayAreaBorderThickness();
///
/// The IsPlayAreaSizeCalibrated method returns whether the given play area size has been auto calibrated by external sensors.
///
/// Returns true if the play area size has been auto calibrated and set by external sensors.
public abstract bool IsPlayAreaSizeCalibrated();
///
/// The GetDrawAtRuntime method returns whether the given play area drawn border is being displayed.
///
/// Returns true if the drawn border is being displayed.
public abstract bool GetDrawAtRuntime();
///
/// The SetDrawAtRuntime method sets whether the given play area drawn border should be displayed at runtime.
///
/// The state of whether the drawn border should be displayed or not.
public abstract void SetDrawAtRuntime(bool value);
protected Transform GetSDKManagerPlayArea()
{
VRTK_SDKManager sdkManager = VRTK_SDKManager.instance;
if (sdkManager != null && sdkManager.loadedSetup.actualBoundaries != null)
{
cachedPlayArea = (sdkManager.loadedSetup.actualBoundaries ? sdkManager.loadedSetup.actualBoundaries.transform : null);
return cachedPlayArea;
}
return null;
}
}
}