Stay organized with collections
Save and categorize content based on your preferences.
XRCameraConfigurationExtensions
Extensions to AR Subsystem's XRCameraConfiguration struct.
Summary
Public static functions
GetDepthSensorUsage
CameraConfigDepthSensorUsage GetDepthSensorUsage(
this XRCameraConfiguration cameraConfig
)
Gets the hardware depth sensor, such as a time-of-flight sensor (or ToF sensor), usage for this camera config.
Details |
Parameters |
cameraConfig
|
An XRCameraConfiguration instance.
|
|
Returns
|
Returns the hardware depth sensor, such as a time-of-flight sensor (or ToF sensor), usage type.
|
GetFPSRange
Vector2Int GetFPSRange(
this XRCameraConfiguration cameraConfig
)
Gets the target camera capture frame rate range for this camera config.
Details |
Parameters |
cameraConfig
|
An XRCameraConfiguration instance.
|
|
Returns
|
Returns the range from minimal target FPS to maximal target FPS.
|
GetFacingDirection
CameraConfigFacingDirection GetFacingDirection(
this XRCameraConfiguration cameraConfig
)
Gets the camera facing direction for this camera config.
Details |
Parameters |
cameraConfig
|
An XRCameraConfiguration instance.
|
|
Returns
|
Returns the camera facing direction.
|
GetStereoCameraUsage
CameraConfigStereoCameraUsage GetStereoCameraUsage(
this XRCameraConfiguration cameraConfig
)
Gets the stereo camera usage for this camera config.
Details |
Parameters |
cameraConfig
|
An XRCameraConfiguration instance.
|
|
Returns
|
Returns the stereo camera usage type.
|
GetTextureDimensions
Vector2Int GetTextureDimensions(
this XRCameraConfiguration cameraConfig
)
Gets the dimensions of the GPU-accessible external texture for this camera config.
Details |
Parameters |
cameraConfig
|
An XRCameraConfiguration instance.
|
|
Returns
|
Returns the GPU texture dimensions.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-14 UTC.
[null,null,["Last updated 2025-07-14 UTC."],[[["\u003cp\u003eXRCameraConfigurationExtensions provides a set of functions to access camera configuration details within AR Subsystems.\u003c/p\u003e\n"],["\u003cp\u003eThese extensions allow developers to retrieve information like depth sensor usage, frame rate range, facing direction, stereo camera usage, and texture dimensions.\u003c/p\u003e\n"],["\u003cp\u003eEach function takes an XRCameraConfiguration instance as input and returns the specific configuration value.\u003c/p\u003e\n"],["\u003cp\u003eThese functions are particularly useful for customizing and optimizing AR experiences based on device camera capabilities.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use these extensions to adapt their applications for different hardware configurations and ensure optimal performance.\u003c/p\u003e\n"]]],[],null,["# XRCameraConfigurationExtensions Class Reference\n\nXRCameraConfigurationExtensions\n===============================\n\nExtensions to AR Subsystem's XRCameraConfiguration struct.\n\nSummary\n-------\n\n| ### Public static functions ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [GetDepthSensorUsage](#getdepthsensorusage)`(this `[XRCameraConfiguration](https://docs.unity3d.com/Packages/com.unity.xr.arsubsystems@4.2/api/UnityEngine.XR.ARSubsystems.XRCameraConfiguration.html)` cameraConfig)` | [CameraConfigDepthSensorUsage](/ar/reference/unity-arf/namespace/Google/XR/ARCoreExtensions#cameraconfigdepthsensorusage) Gets the hardware depth sensor, such as a time-of-flight sensor (or ToF sensor), usage for this camera config. |\n| [GetFPSRange](#getfpsrange)`(this `[XRCameraConfiguration](https://docs.unity3d.com/Packages/com.unity.xr.arsubsystems@4.2/api/UnityEngine.XR.ARSubsystems.XRCameraConfiguration.html)` cameraConfig)` | [Vector2Int](https://docs.unity3d.com/ScriptReference/Vector2Int.html) Gets the target camera capture frame rate range for this camera config. |\n| [GetFacingDirection](#getfacingdirection)`(this `[XRCameraConfiguration](https://docs.unity3d.com/Packages/com.unity.xr.arsubsystems@4.2/api/UnityEngine.XR.ARSubsystems.XRCameraConfiguration.html)` cameraConfig)` | [CameraConfigFacingDirection](/ar/reference/unity-arf/namespace/Google/XR/ARCoreExtensions#cameraconfigfacingdirection) Gets the camera facing direction for this camera config. |\n| [GetStereoCameraUsage](#getstereocamerausage)`(this `[XRCameraConfiguration](https://docs.unity3d.com/Packages/com.unity.xr.arsubsystems@4.2/api/UnityEngine.XR.ARSubsystems.XRCameraConfiguration.html)` cameraConfig)` | [CameraConfigStereoCameraUsage](/ar/reference/unity-arf/namespace/Google/XR/ARCoreExtensions#cameraconfigstereocamerausage) Gets the stereo camera usage for this camera config. |\n| [GetTextureDimensions](#gettexturedimensions)`(this `[XRCameraConfiguration](https://docs.unity3d.com/Packages/com.unity.xr.arsubsystems@4.2/api/UnityEngine.XR.ARSubsystems.XRCameraConfiguration.html)` cameraConfig)` | [Vector2Int](https://docs.unity3d.com/ScriptReference/Vector2Int.html) Gets the dimensions of the GPU-accessible external texture for this camera config. |\n\nPublic static functions\n-----------------------\n\n### GetDepthSensorUsage\n\n```c#\nCameraConfigDepthSensorUsage GetDepthSensorUsage(\n this XRCameraConfiguration cameraConfig\n)\n``` \nGets the hardware depth sensor, such as a time-of-flight sensor (or ToF sensor), usage for this camera config.\n\n\n| Details ||\n|-------------|-----------------------------------------------------------------------------------------------------------------|\n| Parameters | |----------------|------------------------------------| | `cameraConfig` | An XRCameraConfiguration instance. | |\n| **Returns** | Returns the hardware depth sensor, such as a time-of-flight sensor (or ToF sensor), usage type. |\n\n### GetFPSRange\n\n```c#\nVector2Int GetFPSRange(\n this XRCameraConfiguration cameraConfig\n)\n``` \nGets the target camera capture frame rate range for this camera config.\n\n\n| Details ||\n|-------------|-----------------------------------------------------------------------------------------------------------------|\n| Parameters | |----------------|------------------------------------| | `cameraConfig` | An XRCameraConfiguration instance. | |\n| **Returns** | Returns the range from minimal target FPS to maximal target FPS. |\n\n### GetFacingDirection\n\n```c#\nCameraConfigFacingDirection GetFacingDirection(\n this XRCameraConfiguration cameraConfig\n)\n``` \nGets the camera facing direction for this camera config.\n\n\n| Details ||\n|-------------|-----------------------------------------------------------------------------------------------------------------|\n| Parameters | |----------------|------------------------------------| | `cameraConfig` | An XRCameraConfiguration instance. | |\n| **Returns** | Returns the camera facing direction. |\n\n### GetStereoCameraUsage\n\n```c#\nCameraConfigStereoCameraUsage GetStereoCameraUsage(\n this XRCameraConfiguration cameraConfig\n)\n``` \nGets the stereo camera usage for this camera config.\n\n\n| Details ||\n|-------------|-----------------------------------------------------------------------------------------------------------------|\n| Parameters | |----------------|------------------------------------| | `cameraConfig` | An XRCameraConfiguration instance. | |\n| **Returns** | Returns the stereo camera usage type. |\n\n### GetTextureDimensions\n\n```c#\nVector2Int GetTextureDimensions(\n this XRCameraConfiguration cameraConfig\n)\n``` \nGets the dimensions of the GPU-accessible external texture for this camera config.\n\n\n| Details ||\n|-------------|-----------------------------------------------------------------------------------------------------------------|\n| Parameters | |----------------|------------------------------------| | `cameraConfig` | An XRCameraConfiguration instance. | |\n| **Returns** | Returns the GPU texture dimensions. |"]]