コード例 #1
0
ファイル: NRAnchor.cs プロジェクト: eric1932/LiveEarthHD
        /// <summary>
        /// Create a anchor for the trackable object
        /// </summary>
        /// <param name="trackable">Instantiate a NRAnchor object which Update trackable pose every frame</param>
        /// <returns>NRAnchor</returns>
        public static NRAnchor Factory(NRTrackable trackable)
        {
            if (trackable == null)
            {
                return(null);
            }

            NRAnchor result;

            if (m_AnchorDict.TryGetValue(trackable.GetDataBaseIndex(), out result))
            {
                return(result);
            }

            NRAnchor anchor = (new GameObject()).AddComponent <NRAnchor>();

            anchor.gameObject.name = "Anchor";
            anchor.Trackable       = trackable;

            m_AnchorDict.Add(trackable.GetDataBaseIndex(), anchor);
            return(anchor);
        }
コード例 #2
0
 /// <summary>
 /// Creates an anchor attached to current trackable at given pose.
 /// </summary>
 internal NRAnchor CreateAnchor()
 {
     return(NRAnchor.Factory(this));
 }
コード例 #3
0
ファイル: NRTrackable.cs プロジェクト: eric1932/LiveEarthHD
 /// <summary>
 /// Creates an anchor attached to current trackable at given pose.
 /// </summary>
 public NRAnchor CreateAnchor()
 {
     return(NRAnchor.Factory(this));
 }