Beispiel #1
0
        /// <summary>
        /// Add a thumbnail host to be tracked by this controller. Note that you will have to call determineVisibleHosts to get
        /// it to actually have a thumbnail.
        /// </summary>
        /// <param name="host"></param>
        public void addThumbnailHost(LiveThumbnailHost host)
        {
            host._HostInfo = new LiveThumbnailHostInfo()
            {
                Host    = host,
                Visible = false,
            };

            thumbnailHosts.Add(host._HostInfo);
        }
Beispiel #2
0
        /// <summary>
        /// Remove a thumbnail host from tracking by this controller.
        /// </summary>
        /// <param name="host"></param>
        public void removeThumbnailHost(LiveThumbnailHost host)
        {
            var hostInfo = host._HostInfo;

            if (hostInfo.Visible)
            {
                returnThumbToPool(hostInfo);
            }
            thumbnailHosts.Remove(hostInfo);
            host._HostInfo = null;
        }
Beispiel #3
0
        /// <summary>
        /// Update the camera and position of a live thumb based off the host.
        /// Set the properties on the host before calling this function.
        /// </summary>
        /// <param name="host"></param>
        public void updateCameraAndLayers(LiveThumbnailHost host)
        {
            LiveThumbnailHostInfo info = host._HostInfo;

            if (info.CurrentSceneView != null)
            {
                info.CurrentSceneView.SceneView.immediatlySetPosition(new CameraPosition()
                {
                    Translation = host.Translation,
                    LookAt      = host.LookAt
                });
                host.Layers.instantlyApplyTo(info.CurrentSceneView.SceneView.CurrentTransparencyState);
                info.CurrentSceneView.SceneView.RenderOneFrame = true;
            }
        }
Beispiel #4
0
        /// <summary>
        /// Set the visiblity of a thumb host, if it is set to visible a live thumb will be created
        /// and if set to false the thumb will be destroyed.
        /// </summary>
        /// <param name="host"></param>
        /// <param name="visible"></param>
        public void setVisibility(LiveThumbnailHost host, bool visible)
        {
            LiveThumbnailHostInfo info = host._HostInfo;

            if (visible != info.Visible)
            {
                info.Visible = visible;
                if (info.Visible)
                {
                    createLiveThumb(info);
                }
                else
                {
                    returnThumbToPool(info);
                }
            }
        }