コード例 #1
0
        /// <summary>
        /// Converts the SyncBoundingBox to Bounds
        /// </summary>
        /// <param name="syncBoundingBox"></param>
        /// <returns></returns>
        public static Bounds ToBounds(this SyncBoundingBox syncBoundingBox)
        {
            Bounds bounds = new Bounds();

            bounds.min = new Vector3(syncBoundingBox.Min.X, syncBoundingBox.Min.Y, syncBoundingBox.Min.Z);
            bounds.max = new Vector3(syncBoundingBox.Max.X, syncBoundingBox.Max.Y, syncBoundingBox.Max.Z);
            return(bounds);
        }
コード例 #2
0
        void SetBoundingBoxValues(BoundingBoxReference boundingBoxReference, SyncBoundingBox syncBoundingBox)
        {
            var min = new Vector3(syncBoundingBox.Min.X, syncBoundingBox.Min.Y, syncBoundingBox.Min.Z);
            var max = new Vector3(syncBoundingBox.Max.X, syncBoundingBox.Max.Y, syncBoundingBox.Max.Z);

            EncapsulateGlobalBounds(min, max);
            var size = max - min;

            boundingBoxReference.gameObject.transform.localPosition = min + (size / 2);
            boundingBoxReference.gameObject.transform.localScale    = size;
        }
コード例 #3
0
        void AddOrEditBoundingBox(StreamKey key, SyncBoundingBox boundingBox, StreamState state, bool show)
        {
            if (!m_BoundingBoxesByStreamKey.TryGetValue(key, out var box))
            {
                box = GetFreeBoundingBoxReference();
                SetBoundingBoxValues(box, boundingBox);
                m_BoundingBoxesByStreamKey.Add(key, box);
            }

            box.gameObject.SetActive(show);
            SetStreamState(box, state);
        }
コード例 #4
0
 public StreamingErrorEvent(StreamKey key, SyncBoundingBox boundingBox, Exception ex)
 {
     Key         = key;
     BoundingBox = boundingBox;
     Exception   = ex;
 }
コード例 #5
0
 public StreamInstance(StreamKey key, SyncObjectInstance instance, SyncBoundingBox boundingBox)
 {
     this.key         = key;
     this.instance    = instance;
     this.boundingBox = boundingBox;
 }
コード例 #6
0
 public StreamAsset(string sourceId, PersistentKey key, string hash, SyncBoundingBox boundingBox)
 {
     this.key         = new StreamKey(sourceId, key);
     this.hash        = hash;
     this.boundingBox = boundingBox;
 }
コード例 #7
0
 /// <summary>
 /// Grows the Bounds to fit the SyncBoundingBox
 /// </summary>
 /// <param name="bounds"></param>
 /// <param name="syncBoundingBox"></param>
 public static void Encapsulate(this Bounds bounds, SyncBoundingBox syncBoundingBox)
 {
     bounds.min = Vector3.Min(bounds.min, new Vector3(syncBoundingBox.Min.X, syncBoundingBox.Min.Y, syncBoundingBox.Min.Z));
     bounds.max = Vector3.Max(bounds.max, new Vector3(syncBoundingBox.Max.X, syncBoundingBox.Max.Y, syncBoundingBox.Max.Z));
 }