public static Vector3 From(this Point32Msg self, CoordinateSpaceSelection selection)
        {
            switch (selection)
            {
            case CoordinateSpaceSelection.RUF:
                return(self.From <RUF>());

            case CoordinateSpaceSelection.FLU:
                return(self.From <FLU>());

            case CoordinateSpaceSelection.FRD:
                return(self.From <FRD>());

            case CoordinateSpaceSelection.ENU:
                return(self.From <ENU>());

            case CoordinateSpaceSelection.NED:
                return(self.From <NED>());

            case CoordinateSpaceSelection.ENULocal:
                return(self.From <ENULocal>());

            case CoordinateSpaceSelection.NEDLocal:
                return(self.From <NEDLocal>());

            default:
                Debug.LogError("Invalid coordinate space " + selection);
                return(self.From <RUF>());
            }
        }
Esempio n. 2
0
        public static void GUI(this Point32Msg message, string name)
        {
            string body = $"[{message.x:F2}, {message.y:F2}, {message.z:F2}]";

            if (name == null || name == "")
            {
                GUILayout.Label(body);
            }
            else
            {
                GUILayout.Label($"{name}: {body}");
            }
        }
Esempio n. 3
0
                public PointCloudMsg(JSONNode msg)
                {
                    _header = new HeaderMsg(msg["header"]);

                    _points = new Point32Msg[msg["points"].Count];
                    for (int i = 0; i < _points.Length; i++)
                    {
                        _points[i] = new Point32Msg(msg["points"][i]);
                    }

                    _channels = new ChannelFloat32[msg["clannels"].Count];
                    for (int i = 0; i < _channels.Length; i++)
                    {
                        _channels[i] = new ChannelFloat32(msg["clannels"][i]);
                    }
                }
Esempio n. 4
0
 public static void GUI(this Point32Msg message)
 {
     GUILayout.Label($"[{message.x:F2}, {message.y:F2}, {message.z:F2}]");
 }
 public static Vector3 From <C>(this Point32Msg self) where C : ICoordinateSpace, new()
 {
     return(new Vector3 <C>(self.x, self.y, self.z).toUnity);
 }