Beispiel #1
0
 static void OnReferencePointUpdated(ReferencePointUpdatedEventArgs eventArgs)
 {
     if (referencePointUpdated != null)
     {
         referencePointUpdated(eventArgs);
     }
 }
        void RaiseReferencePointUpdatedEvent(ReferencePointUpdatedEventArgs eventArgs, ARReferencePoint referencePoint)
        {
            if (referencePointUpdated == null)
            {
                return;
            }

            referencePointUpdated(new ARReferencePointUpdatedEventArgs(
                                      referencePoint,
                                      eventArgs.PreviousTrackingState,
                                      eventArgs.PreviousPose));
        }
Beispiel #3
0
        void OnReferencePointUpdated(ReferencePointUpdatedEventArgs eventArgs)
        {
            var referencePointData          = eventArgs.ReferencePoint;
            ARReferencePoint referencePoint = TryGetReferencePoint(referencePointData.Id);

            if (referencePoint == null)
            {
                referencePoint = CreateArReferencePoint(eventArgs.ReferencePoint);
            }

            referencePoint.sessionRelativeData = referencePointData;

            // Notify event subscribers
            RaiseReferencePointUpdatedEvent(eventArgs, referencePoint);
        }
        void OnReferencePointUpdated(ReferencePointUpdatedEventArgs eventArgs)
        {
            var referencePointData          = eventArgs.ReferencePoint;
            ARReferencePoint referencePoint = TryGetReferencePoint(referencePointData.Id);

            if (referencePoint == null)
            {
                // We aren't responsible for this reference point, so ignore it.
                return;
            }

            referencePoint.sessionRelativeData = referencePointData;

            // Notify event subscribers
            RaiseReferencePointUpdatedEvent(eventArgs, referencePoint);
        }
Beispiel #5
0
        private void ProcessRerencePointUpdated(ReferencePointUpdatedEventArgs obj)
        {
            referenceUpdateData.eventType    = -1;
            referenceUpdateData.eventSubType = 1;

            IdToArray idToArray;

            unsafe
            {
                var id  = obj.ReferencePoint.Id;
                var ptr = (TrackableId *)&id;
                idToArray = *(IdToArray *)ptr;
            }

            //byte[] idToByte = DataSender.StructToByteArray<TrackableId>(obj.ReferencePoint.Id);
            //DataSender.IdToArray idToArray = DataSender.ByteArrayToType<DataSender.IdToArray>(idToByte);

            referenceUpdateData.id1 = idToArray.id0;
            referenceUpdateData.id2 = idToArray.id1;

            referenceUpdateData.trackingState = (int)obj.ReferencePoint.TrackingState;

            referenceUpdateData.px = obj.ReferencePoint.Pose.position.x;
            referenceUpdateData.py = obj.ReferencePoint.Pose.position.y;
            referenceUpdateData.pz = obj.ReferencePoint.Pose.position.z;

            referenceUpdateData.rx = obj.ReferencePoint.Pose.rotation.x;
            referenceUpdateData.ry = obj.ReferencePoint.Pose.rotation.y;
            referenceUpdateData.rz = obj.ReferencePoint.Pose.rotation.z;
            referenceUpdateData.rw = obj.ReferencePoint.Pose.rotation.w;

            referenceUpdateData.ppx = obj.PreviousPose.position.x;
            referenceUpdateData.ppy = obj.PreviousPose.position.y;
            referenceUpdateData.ppz = obj.PreviousPose.position.z;

            referenceUpdateData.prx = obj.PreviousPose.rotation.x;
            referenceUpdateData.pry = obj.PreviousPose.rotation.y;
            referenceUpdateData.prz = obj.PreviousPose.rotation.z;
            referenceUpdateData.prw = obj.PreviousPose.rotation.w;

            referenceUpdateData.previousTrackingState = (int)obj.PreviousTrackingState;

            if (dataSender != null)
            {
                dataSender.SendReferenePointUpdate(connectionProvider, referenceUpdateData);
            }
        }