コード例 #1
0
        public static void ImplicitTest()
        {
            BoundedPlane p1 = new BoundedPlane()
            {
                trackableId  = new TrackableId(0, 1),
                subsumedById = new TrackableId(2, 3),
                center       = new float2(0.2f, 0.3f),
                pose         = new Pose()
                {
                    position = new float3(0.1f, 0.2f, 0.3f),
                    rotation = Quaternion.Euler(10, 20, 30).ToFloat4(),
                },
                size           = new float2(1, 2),
                alignment      = PlaneAlignment.Vertical,
                trackingState  = TrackingState.Limited,
                nativePtr      = new IntPtr(100),
                classification = PlaneClassification.Seat,
            };

            UnityBoundedPlane p2 = p1;

            Debug.Log(p2);

            BoundedPlane p3 = p2;

            Assert.AreEqual(p1, p3);
        }
コード例 #2
0
            public override TrackableChanges <UnityBoundedPlane> GetChanges(
                UnityBoundedPlane defaultPlane,
                Allocator allocator)
            {
                var plane = ARKitReceiver.Instance?.Plane;

                if (plane == null)
                {
                    return(new TrackableChanges <UnityBoundedPlane>());
                }

                var added   = plane.added.Select(p => (UnityBoundedPlane)p).ToList();
                var updated = plane.updated.Select(p => (UnityBoundedPlane)p).ToList();
                var removed = plane.removed.Select(p => (UnityTrackableId)p).ToList();

                return(modifier.Modify(added, updated, removed, allocator));
            }
コード例 #3
0
 /// <summary>
 /// Get the changes (added, updated, and removed) planes since the last call to
 /// <see cref="GetChanges(BoundedPlane,Allocator)"/>.
 /// </summary>
 /// <param name="defaultPlane">
 /// The default plane. This should be used to initialize the returned <c>NativeArray</c>s for backwards compatibility.
 /// See <see cref="TrackableChanges{T}.TrackableChanges(void*, int, void*, int, void*, int, T, int, Allocator)"/>.
 /// </param>
 /// <param name="allocator">An <c>Allocator</c> to use when allocating the returned <c>NativeArray</c>s.</param>
 /// <returns>
 /// <see cref="TrackableChanges{T}"/> describing the planes that have been added, updated, and removed
 /// since the last call to <see cref="GetChanges(BoundedPlane,Allocator)"/>. The changes should be allocated using
 /// <paramref name="allocator"/>.
 /// </returns>
 public abstract TrackableChanges <BoundedPlane> GetChanges(BoundedPlane defaultPlane, Allocator allocator);
コード例 #4
0
 /// <summary>
 /// Get the changes (added, updated, and removed) planes since the last call to <see cref="GetChanges(Allocator)"/>.
 /// </summary>
 /// <param name="defaultPlane">
 /// The default plane. This should be used to initialize the returned <c>NativeArray</c>s for backwards compatibility.
 /// See <see cref="TrackableChanges{T}.TrackableChanges(void*, int, void*, int, void*, int, T, int, Allocator)"/>.
 /// </param>
 /// <param name="allocator">An <c>Allocator</c> to use when allocating the returned <c>NativeArray</c>s.</param>
 /// <returns>
 /// <see cref="TrackableChanges{T}"/> describing the planes that have been added, updated, and removed
 /// since the last call to <see cref="GetChanges(Allocator)"/>. The changes should be allocated using
 /// <paramref name="allocator"/>.
 /// </returns>
 public virtual TrackableChanges <BoundedPlane> GetChanges(
     BoundedPlane defaultPlane,
     Allocator allocator)
 {
     return(default(TrackableChanges <BoundedPlane>));
 }