public Marker(SyncMarker syncMarker)
        {
            m_Id   = syncMarker.Id;
            m_Name = syncMarker.Name;

            m_RelativePosition      = new Vector3(syncMarker.Transform.Position.X, syncMarker.Transform.Position.Y, syncMarker.Transform.Position.Z);
            m_RelativeRotationEuler = new Quaternion(syncMarker.Transform.Rotation.X, syncMarker.Transform.Rotation.Y, syncMarker.Transform.Rotation.Z, syncMarker.Transform.Rotation.W).eulerAngles;
            m_ObjectScale           = new Vector3(syncMarker.Transform.Scale.X, syncMarker.Transform.Scale.Y, syncMarker.Transform.Scale.Z);
            m_CreatedTime           = syncMarker.CreatedTime;
            m_LastUpdatedTime       = syncMarker.LastUpdatedTime;
            m_LastUsedTime          = syncMarker.LastUsedTime;
        }
Пример #2
0
        // Start is called before the first frame update
        private void Start()
        {
            List <SyncMarker> markers = new List <SyncMarker>();
            //Create an updated sync marker
            SyncMarker marker = new SyncMarker(new SyncId("Marker"), "VLMarker1")
            {
                Transform = new SyncTransform(
                    new System.Numerics.Vector3(25, 50, 0),
                    System.Numerics.Quaternion.CreateFromYawPitchRoll(0, 0, 0),
                    System.Numerics.Vector3.One)
            };

            markers.Add(marker);
            LoginToPublisher();
            publisher.PerformUpdate(markers);
        }
        public static SyncMarker ToSyncMarker(IMarker marker)
        {
            if (marker == null)
            {
                return(null);
            }

            SyncMarker response = new SyncMarker(marker.Id, marker.Name);

            System.Numerics.Vector3 syncPos   = new System.Numerics.Vector3(marker.RelativePosition.x, marker.RelativePosition.y, marker.RelativePosition.z);
            System.Numerics.Vector3 syncScale = new System.Numerics.Vector3(marker.ObjectScale.x, marker.ObjectScale.y, marker.ObjectScale.z);
            Quaternion rot = Quaternion.Euler(marker.RelativeRotationEuler);

            System.Numerics.Quaternion syncRot = new System.Numerics.Quaternion(rot.x, rot.y, rot.z, rot.w);
            response.Transform       = new SyncTransform(syncPos, syncRot, syncScale);
            response.CreatedTime     = marker.CreatedTime;
            response.LastUpdatedTime = marker.LastUpdatedTime;
            response.LastUsedTime    = marker.LastUsedTime;
            return(response);
        }