docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct ArCameraConfigFilter

    Used to filter the set of camera configurations returned by XRCameraSubsystem.GetConfigurations.

    Implements
    IDisposable
    IEquatable<ArCameraConfigFilter>
    Inherited Members
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.ARCore
    Assembly: Unity.XR.ARCore.dll
    Syntax
    public struct ArCameraConfigFilter : IDisposable, IEquatable<ArCameraConfigFilter>

    Constructors

    ArCameraConfigFilter(ArSession)

    Creates a new, default-constructed instance.

    Declaration
    public ArCameraConfigFilter(ArSession session)
    Parameters
    Type Name Description
    ArSession session

    A non-null ARSession.

    Remarks

    When you no longer need the ArCameraConfigFilter, you must destroy it by calling Dispose(). If you do not dispose it, ARCore will leak memory.

    See Also
    beforeGetCameraConfiguration
    ARCoreBeforeGetCameraConfigurationEventArgs

    Methods

    AsIntPtr()

    Gets the native pointer for this instance.

    Declaration
    public IntPtr AsIntPtr()
    Returns
    Type Description
    IntPtr

    The native pointer.

    See Also
    beforeGetCameraConfiguration
    ARCoreBeforeGetCameraConfigurationEventArgs

    Dispose()

    Destroys this instance and sets its native pointer to null.

    Declaration
    public void Dispose()
    Remarks

    You should only dispose an ArCameraConfigFilter if you explicitly created it, e.g., by calling ArCameraConfigFilter(ArSession). If you convert an existing config from an IntPtr (e.g., by calling FromIntPtr(IntPtr)), then you should not dispose it.

    See Also
    beforeGetCameraConfiguration
    ARCoreBeforeGetCameraConfigurationEventArgs

    Equals(object)

    Tests for equality.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    An object to compare against.

    Returns
    Type Description
    bool

    true if obj is an ArCameraConfigFilter and compares equal to this instance using Equals(ArCameraConfigFilter).

    Overrides
    ValueType.Equals(object)
    See Also
    beforeGetCameraConfiguration
    ARCoreBeforeGetCameraConfigurationEventArgs

    Equals(ArCameraConfigFilter)

    Tests for equality.

    Declaration
    public bool Equals(ArCameraConfigFilter other)
    Parameters
    Type Name Description
    ArCameraConfigFilter other

    The instance to compare against.

    Returns
    Type Description
    bool

    true if the native pointers are equal. Otherwise, returns false.

    Remarks

    Two instances are considered equal if their native pointers are equal.

    See Also
    beforeGetCameraConfiguration
    ARCoreBeforeGetCameraConfigurationEventArgs

    FromIntPtr(IntPtr)

    Creates an instance from a native pointer. The native pointer must point to an existing native ArCameraConfigFilter.

    Declaration
    public static ArCameraConfigFilter FromIntPtr(IntPtr value)
    Parameters
    Type Name Description
    IntPtr value

    A pointer to an existing native ArCameraConfigFilter.

    Returns
    Type Description
    ArCameraConfigFilter

    An instance whose native pointer is value.

    See Also
    beforeGetCameraConfiguration
    ARCoreBeforeGetCameraConfigurationEventArgs

    GetDepthSensorUsage(ArSession)

    Gets the desired depth sensor usages to allow.

    Declaration
    public ArCameraConfigDepthSensorUsage GetDepthSensorUsage(ArSession session)
    Parameters
    Type Name Description
    ArSession session

    The ARCore session.

    Returns
    Type Description
    ArCameraConfigDepthSensorUsage

    The ArCameraConfigDepthSensorUsage values allowed by this filter.

    See Also
    beforeGetCameraConfiguration
    ARCoreBeforeGetCameraConfigurationEventArgs

    GetHashCode()

    Generates a hash code suitable for use with a HashSet or Dictionary

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for this instance.

    Overrides
    ValueType.GetHashCode()
    See Also
    beforeGetCameraConfiguration
    ARCoreBeforeGetCameraConfigurationEventArgs

    GetTargetFps(ArSession)

    Gets the desired frame rates to allow.

    Declaration
    public ArCameraConfigTargetFps GetTargetFps(ArSession session)
    Parameters
    Type Name Description
    ArSession session

    The ARCore session.

    Returns
    Type Description
    ArCameraConfigTargetFps

    The frame rates allowed by this filter.

    See Also
    beforeGetCameraConfiguration
    ARCoreBeforeGetCameraConfigurationEventArgs

    SetDepthSensorUsage(ArSession, ArCameraConfigDepthSensorUsage)

    Sets the desired depth sensor usages to allow.

    Declaration
    public void SetDepthSensorUsage(ArSession session, ArCameraConfigDepthSensorUsage depthSensorUsage)
    Parameters
    Type Name Description
    ArSession session

    The ARCore session.

    ArCameraConfigDepthSensorUsage depthSensorUsage

    The ArCameraConfigDepthSensorUsage values allowed by this filter.

    See Also
    beforeGetCameraConfiguration
    ARCoreBeforeGetCameraConfigurationEventArgs

    SetTargetFps(ArSession, ArCameraConfigTargetFps)

    Sets the desired frame rates to allow.

    Declaration
    public void SetTargetFps(ArSession session, ArCameraConfigTargetFps targetFps)
    Parameters
    Type Name Description
    ArSession session

    The ARCore session.

    ArCameraConfigTargetFps targetFps

    The frame rates allowed by this filter.

    See Also
    beforeGetCameraConfiguration
    ARCoreBeforeGetCameraConfigurationEventArgs

    Operators

    operator ==(ArCameraConfigFilter?, ArCameraConfigFilter?)

    Tests for equality.

    Declaration
    public static bool operator ==(ArCameraConfigFilter? lhs, ArCameraConfigFilter? rhs)
    Parameters
    Type Name Description
    ArCameraConfigFilter? lhs

    The nullable ArCameraConfigFilter to compare with rhs.

    ArCameraConfigFilter? rhs

    The nullable ArCameraConfigFilter to compare with lhs.

    Returns
    Type Description
    bool

    true if any of these conditions are met: - lhs and rhs are both not null and their native pointers are equal. - lhs is null and rhs's native pointer is null. - rhs is null and lhs's native pointer is null. - Both lhs and rhs are null.

     Otherwise, returns <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a>.
    
    Remarks

    This equality operator lets you compare an ArCameraConfigFilter with null to determine whether its native pointer is null.

    Examples
    bool TestForNull(ArCameraConfigFilter obj)
    {
        if (obj == null)
        {
            // obj.AsIntPtr() is IntPtr.Zero
        }
    }
    See Also
    beforeGetCameraConfiguration
    ARCoreBeforeGetCameraConfigurationEventArgs

    operator ==(ArCameraConfigFilter, ArCameraConfigFilter)

    Tests for equality. Equivalent to Equals(ArCameraConfigFilter).

    Declaration
    public static bool operator ==(ArCameraConfigFilter lhs, ArCameraConfigFilter rhs)
    Parameters
    Type Name Description
    ArCameraConfigFilter lhs

    The instance to compare with rhs.

    ArCameraConfigFilter rhs

    The instance to compare with lhs.

    Returns
    Type Description
    bool

    true if lhs is equal to rhs using Equals(ArCameraConfigFilter). Otherwise, returns false.

    See Also
    beforeGetCameraConfiguration
    ARCoreBeforeGetCameraConfigurationEventArgs

    explicit operator IntPtr(ArCameraConfigFilter)

    Casts an instance to its underlying native pointer.

    Declaration
    public static explicit operator IntPtr(ArCameraConfigFilter filter)
    Parameters
    Type Name Description
    ArCameraConfigFilter filter

    The instance to cast.

    Returns
    Type Description
    IntPtr

    Returns the underlying native pointer for filter

    See Also
    beforeGetCameraConfiguration
    ARCoreBeforeGetCameraConfigurationEventArgs

    operator !=(ArCameraConfigFilter?, ArCameraConfigFilter?)

    Tests for inequality.

    Declaration
    public static bool operator !=(ArCameraConfigFilter? lhs, ArCameraConfigFilter? rhs)
    Parameters
    Type Name Description
    ArCameraConfigFilter? lhs

    The nullable ArCameraConfigFilter to compare with rhs.

    ArCameraConfigFilter? rhs

    The nullable ArCameraConfigFilter to compare with lhs.

    Returns
    Type Description
    bool

    false if any of these conditions are met: - lhs and rhs are both not null and their native pointers are equal. - lhs is null and rhs's native pointer is null. - rhs is null and lhs's native pointer is null. - Both lhs and rhs are null.

     Otherwise, returns <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a>.
    
    Remarks

    This inequality operator lets you compare an ArCameraConfigFilter with null to determine whether its native pointer is null.

    Examples
    bool TestForNull(ArCameraConfigFilter obj)
    {
        if (obj != null)
        {
            // obj.AsIntPtr() is not IntPtr.Zero
        }
    }
    See Also
    beforeGetCameraConfiguration
    ARCoreBeforeGetCameraConfigurationEventArgs

    operator !=(ArCameraConfigFilter, ArCameraConfigFilter)

    Tests for inequality. Equivalent to the negation of Equals(ArCameraConfigFilter).

    Declaration
    public static bool operator !=(ArCameraConfigFilter lhs, ArCameraConfigFilter rhs)
    Parameters
    Type Name Description
    ArCameraConfigFilter lhs

    The ArCameraConfigFilter to compare with rhs.

    ArCameraConfigFilter rhs

    The ArCameraConfigFilter to compare with lhs.

    Returns
    Type Description
    bool

    false if lhs is equal to rhs using Equals(ArCameraConfigFilter). Otherwise, returns true.

    See Also
    beforeGetCameraConfiguration
    ARCoreBeforeGetCameraConfigurationEventArgs

    Implements

    IDisposable
    IEquatable<T>

    See Also

    beforeGetCameraConfiguration
    ARCoreBeforeGetCameraConfigurationEventArgs
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)