Beispiel #1
0
        public void ProcessDepthData(DepthData planeData)
        {
            if (!EditorApplication.isPlaying)
            {
                return;
            }

            var planeDataBytes = RemotingUtils.StructToByteArray <DepthData>(planeData);

            ProcessDepthData(planeDataBytes);
        }
Beispiel #2
0
        static IntPtr AddReferencePointHandler(float px, float py, float pz,
                                               float rx, float ry, float rz, float rw)
        {
            Instance.SeparateThreadConnectionProvider.OnStreamReceived += SeparateThreadConnectionProvider_OnStreamReceived;

            MemoryStream stream = new MemoryStream(1024 * 1024);

            PacketWriter writer = new PacketWriter();

            writer.BeginMessage((byte)RemoteMessageID.ARReferencePointAdd);
            writer.Write(px);
            writer.Write(py);
            writer.Write(pz);
            writer.Write(rx);
            writer.Write(ry);
            writer.Write(rz);
            writer.Write(rw);
            writer.EndMessage(stream);

            Instance.SeparateThreadConnectionProvider.Update();

            Instance.SeparateThreadConnectionProvider.SendMessage(stream);

            while (!hasResponse)
            {
                Thread.Sleep(250);

                Instance.SeparateThreadConnectionProvider.Update();
            }


            Instance.SeparateThreadConnectionProvider.OnStreamReceived -= SeparateThreadConnectionProvider_OnStreamReceived;

            response.result = true;
            NativeApi.UnityXRMock_addReferenceResultData(response.id1, response.id2, response.result, response.trackingState);

            byte[] bytesToSend = RemotingUtils.StructToByteArray <NativeApi.AddReferenceResult>(response);

            IntPtr ptr = Marshal.AllocHGlobal(bytesToSend.Length);

            Marshal.StructureToPtr(response, ptr, false);

            return(ptr);
        }
Beispiel #3
0
        public void ProcessPlane(BoundedPlaneData planeData)
        {
            var planeDataBytes = RemotingUtils.StructToByteArray <BoundedPlaneData>(planeData);

            ProcessPlane(planeDataBytes);
        }
Beispiel #4
0
        public void UpdateFrameData(CameraFrameData frameData)
        {
            var frameDataBytes = RemotingUtils.StructToByteArray <CameraFrameData>(frameData);

            UpdateFrameData(frameDataBytes);
        }