Class ARTrackable<TSessionRelativeData, TTrackable> | AR Foundation | 3.0.1
docs.unity3d.com
    Show / Hide Table of Contents

    Class ARTrackable<TSessionRelativeData, TTrackable>

    A generic component for trackables. A "trackable" is a feature in the physical environment that can be detected and tracked by an XR device.

    Inheritance
    Object
    ARTrackable<TSessionRelativeData, TTrackable>
    ARAnchor
    AREnvironmentProbe
    ARFace
    ARParticipant
    ARPlane
    ARPointCloud
    ARTrackedImage
    Namespace: UnityEngine.XR.ARFoundation
    Syntax
    public class ARTrackable<TSessionRelativeData, TTrackable> : MonoBehaviour where TSessionRelativeData : struct, ITrackable where TTrackable : ARTrackable<TSessionRelativeData, TTrackable>
    Type Parameters
    Name Description
    TSessionRelativeData

    The raw, session relative data type used to update this trackable.

    TTrackable

    The concrete class which derives from ARTrackable<TSessionRelativeData, TTrackable>.

    Properties

    destroyOnRemoval

    If true, this component's GameObject will be removed immediately when the XR device reports this trackable is no longer tracked.

    Declaration
    public bool destroyOnRemoval { get; set; }
    Property Value
    Type Description
    Boolean
    Remarks

    Setting this to false will keep the GameObject around. You may want to do this, for example, if you have custom removal logic, such as a fade out.

    pending

    Pending means the trackable was added manually (usually via an AddTrackable-style method on its manager) but has not yet been reported as added.

    Declaration
    public bool pending { get; }
    Property Value
    Type Description
    Boolean

    sessionRelativeData

    The session-relative data associated with this trackable.

    Declaration
    protected TSessionRelativeData sessionRelativeData { get; }
    Property Value
    Type Description
    TSessionRelativeData

    trackableId

    The TrackableId associated with this trackable. TrackableIds are typically unique to a particular session.

    Declaration
    public TrackableId trackableId { get; }
    Property Value
    Type Description
    TrackableId

    trackingState

    The tracking state associated with this trackable.

    Declaration
    public TrackingState trackingState { get; }
    Property Value
    Type Description
    TrackingState

    Methods

    OnAfterSetSessionRelativeData()

    Invoked just after the session-relative data has been set. The GameObject's transform has already been updated. You may override this method to perform further updates specific to the derived trackable.

    Declaration
    protected virtual void OnAfterSetSessionRelativeData()
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023