/// <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); }
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; }
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); }
public StreamingErrorEvent(StreamKey key, SyncBoundingBox boundingBox, Exception ex) { Key = key; BoundingBox = boundingBox; Exception = ex; }
public StreamInstance(StreamKey key, SyncObjectInstance instance, SyncBoundingBox boundingBox) { this.key = key; this.instance = instance; this.boundingBox = boundingBox; }
public StreamAsset(string sourceId, PersistentKey key, string hash, SyncBoundingBox boundingBox) { this.key = new StreamKey(sourceId, key); this.hash = hash; this.boundingBox = boundingBox; }
/// <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)); }