Class ARCameraManager
Manages the lifetime of the XRCameraSubsystem
. Add one of these to a Camera
in your scene
if you want camera texture and light estimation information to be available.
Inheritance
Implements
Inherited Members
Namespace: UnityEngine.XR.ARFoundation
Assembly: solution.dll
Syntax
[DefaultExecutionOrder(-2147483647)]
[DisallowMultipleComponent]
[RequireComponent(typeof(Camera))]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/api/UnityEngine.XR.ARFoundation.ARCameraManager.html")]
public sealed class ARCameraManager : SubsystemLifecycleManager<XRCameraSubsystem, XRCameraSubsystemDescriptor, XRCameraSubsystem.Provider>, ISerializationCallbackReceiver
Properties
Name | Description |
---|---|
autoFocusEnabled | Get the current focus mode in use by the subsystem, or |
autoFocusRequested | Get or set whether auto focus is requested. |
cameraMaterial | The material used in background rendering. |
currentConfiguration | The current camera configuration. |
currentFacingDirection | The current camera facing direction. This should usually match requestedFacingDirection but might be different if the platform cannot service the requested camera facing direction, or it might take a few frames for the requested facing direction to become active. |
currentLightEstimation | Get the current light estimation mode used by the subsystem, or |
focusMode | Get or set the focus mode. This method is obsolete. The getter uses autoFocusEnabled and the setter uses autoFocusRequested. |
lightEstimationMode | Get or set the light estimation mode. This method is obsolete. The getter uses currentLightEstimation and the setter uses requestedLightEstimation. |
permissionGranted | Determines whether camera permission has been granted. |
requestedFacingDirection | Get or set the requested camera facing direction. |
requestedLightEstimation | Get or set the requested |
Methods
Name | Description |
---|---|
GetConfigurations(Allocator) | Get the camera configurations currently supported for the implementation. |
OnAfterDeserialize() | Part of the ISerializationCallbackReceiver interface. Invoked after deserialization. |
OnBeforeSerialize() | Part of the ISerializationCallbackReceiver interface. Invoked before serialization. |
OnBeforeStart() | Callback before the subsystem is started (but after it is created). |
OnDisable() | Callback when the manager is disabled. |
TryAcquireLatestCpuImage(out XRCpuImage) | Attempts to acquire the latest camera image. This provides direct access to the raw pixel data, as well as to utilities to convert to RGB and Grayscale formats. |
TryGetIntrinsics(out XRCameraIntrinsics) | Tries to get camera intrinsics. Camera intrinsics refers to properties of a physical camera which might be useful when performing additional computer vision processing on the camera image. |
TryGetLatestImage(out XRCpuImage) | Attempts to acquire the latest camera image. This provides direct access to the raw pixel data, as well as to utilities to convert to RGB and Grayscale formats. This method is deprecated. Use TryAcquireLatestCpuImage(out XRCpuImage) instead. |
Events
Name | Description |
---|---|
frameReceived | An event which fires each time a new camera frame is received. |