/// <summary> /// Checks whether the provided <c><see cref="GeospatialMode"/></c> is supported on this /// device. The current list of supported devices is documented on the <a /// href="https://developers.google.com/ar/devices">ARCore supported devices</a> /// page. A device may be incompatible with a given mode due to insufficient sensor /// capabilities. /// </summary> /// <param name="mode">The desired geospatial mode.</param> /// <returns> /// Indicates whether the given mode is supported on this device. /// It will return <c>FeatureSupported.Unknown</c> if the session is still under /// initialization. /// </returns> public FeatureSupported IsGeospatialModeSupported(GeospatialMode mode) { if (ARCoreExtensions._instance.currentARCoreSessionHandle == IntPtr.Zero) { return(FeatureSupported.Unknown); } return(SessionApi.IsGeospatialModeSupported( ARCoreExtensions._instance.currentARCoreSessionHandle, mode)); }
public static FeatureSupported IsGeospatialModeSupported( IntPtr sessionHandle, GeospatialMode mode) { FeatureSupported supported = FeatureSupported.Unknown; #if !UNITY_IOS || GEOSPATIAL_IOS_SUPPORT int isSupported = 0; ExternApi.ArSession_isGeospatialModeSupported( sessionHandle, mode.ToApiGeospatialMode(), ref isSupported); supported = isSupported == 0 ? FeatureSupported.Unsupported : FeatureSupported.Supported; #endif return(supported); }
public static ApiGeospatialMode ToApiGeospatialMode(this GeospatialMode mode) { switch (mode) { case GeospatialMode.Enabled: return(ApiGeospatialMode.Enabled); case GeospatialMode.Disabled: return(ApiGeospatialMode.Disabled); default: Debug.LogErrorFormat("Unrecognized GeospatialMode value: {0}", mode); return(ApiGeospatialMode.Disabled); } }
/// <summary> /// ValueType copy from another ARCoreExtensionsConfig object into this one. /// </summary> /// <param name="otherConfig">The ARCoreExtensionsConfig to copy from.</param> public void CopyFrom(ARCoreExtensionsConfig otherConfig) { CloudAnchorMode = otherConfig.CloudAnchorMode; GeospatialMode = otherConfig.GeospatialMode; }