docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct ARWorldMap

    The space-mapping state and set of planes and anchors from an AR session. This is a wrapper for ARKit's ARWorldMap. Note: The ARWorldMap must be explicitly disposed to avoid leaking native resources.

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

    Properties

    valid

    Use this to determine whether this ARWorldMap is valid, or if it has been disposed.

    Declaration
    public bool valid { get; }
    Property Value
    Type Description
    bool

    Methods

    Dispose()

    Disposes of the world map. This releases the native ARWorldMap resource.

    Declaration
    public void Dispose()

    Equals(object)

    Tests for equality.

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

    The object to compare against.

    Returns
    Type Description
    bool

    True if obj is of type ARWorldMap and Equals(ARWorldMap) also returns true; otherwise false.

    Overrides
    ValueType.Equals(object)

    Equals(ARWorldMap)

    Tests for equality.

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

    The other ARWorldMap to compare against.

    Returns
    Type Description
    bool

    True if every field in other is equal to this ARWorldMap, otherwise false.

    GetHashCode()

    Generates a hash suitable for use with containers like HashSet and Dictionary.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code generated from this object's fields.

    Overrides
    ValueType.GetHashCode()

    Serialize(Allocator)

    Serialize the ARWorldMap to an array of bytes. This array can be saved to disk and loaded at another time to persist the session, or sent over a network to another ARKit-enabled app to share the session. It is an error to call this method after the ARWorldMap has been disposed. The caller owns the returned NativeArray and is responsible for disposing it.

    Declaration
    public NativeArray<byte> Serialize(Allocator allocator)
    Parameters
    Type Name Description
    Allocator allocator

    The allocator to use for the returned NativeArray of bytes.

    Returns
    Type Description
    NativeArray<byte>

    An array of bytes representing the serialized ARWorldMap. The caller owns the memory and is responsible for disposing the NativeArray.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if the world map is not valid.

    InvalidOperationException

    Thrown if the world map could not be serialized to a byte array.

    TryDeserialize(NativeArray<byte>, out ARWorldMap)

    Create a new ARWorldMap from a NativeArray of bytes produced from Serialize(Allocator). Use this to create an ARWorldMap from a serialized array of bytes, either loaded from disk or sent from another device.

    Declaration
    public static bool TryDeserialize(NativeArray<byte> serializedWorldMap, out ARWorldMap worldMap)
    Parameters
    Type Name Description
    NativeArray<byte> serializedWorldMap

    An array of bytes representing a serialized ARWorldMap, produced by Serialize(Allocator).

    ARWorldMap worldMap

    On success, holds the deserialized ARWorldMap.

    Returns
    Type Description
    bool

    True if serializedWorldMap was successfully deserialized, otherwise false.

    Operators

    operator ==(ARWorldMap, ARWorldMap)

    Tests for equality. Same as Equals(ARWorldMap).

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

    The left-hand side of the comparison.

    ARWorldMap rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    bool

    True if lhs is equal to rhs, otherwise false.

    operator !=(ARWorldMap, ARWorldMap)

    Tests for inequality. Same as !Equals(ARWorldMap).

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

    The left-hand side of the comparison.

    ARWorldMap rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    bool

    True if lhs is not equal to rhs, otherwise false.

    Implements

    IDisposable
    IEquatable<T>
    In This Article
    Back to top
    Copyright © 2024 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)