/// <summary> /// /// </summary> /// <param name="page"></param> private void UnLoadPage(GeometryPage page) { //Calculate boundaries to unload PageInfo info = new PageInfo(); float halfPageSize = mMainGeom.PageSize * 0.5f; info.Bounds = new TBounds(0, 0, 0, 0); info.Bounds.Left = page.CenterPoint.x - halfPageSize; info.Bounds.Right = page.CenterPoint.x + halfPageSize; info.Bounds.Top = page.CenterPoint.z - halfPageSize; info.Bounds.Bottom = page.CenterPoint.z + halfPageSize; info.CenterPoint = page.CenterPoint; info.XIndex = page.mXIndex; info.ZIndex = page.mZIndex; info.UserData = page.mUserData; page.RemoveEntites(); mMainGeom.PageLoader.UnloadPage(info); page.mUserData = null; page.mNeedsUnload = false; page.ClearBoundingBox(); page.InactiveTime = 0; page.mIsLoaded = false; page.mIsFadeEnabled = false; }
/// <summary> /// /// </summary> /// <param name="page"></param> private void LoadPage(GeometryPage page) { //Calculate page info PageInfo info = new PageInfo(); float halfPageSize = mMainGeom.PageSize * 0.5f; info.Bounds = new TBounds(0, 0, 0, 0); info.Bounds.Left = page.CenterPoint.x - halfPageSize; info.Bounds.Right = page.CenterPoint.x + halfPageSize; info.Bounds.Top = page.CenterPoint.z - halfPageSize; info.Bounds.Bottom = page.CenterPoint.z + halfPageSize; info.CenterPoint = page.CenterPoint; info.XIndex = page.mXIndex; info.ZIndex = page.mZIndex; info.UserData = page.mUserData; //Check if page needs unloading (if a delayed unload has been issued) if (page.mNeedsUnload) { page.RemoveEntites(); mMainGeom.PageLoader.UnloadPage(info); page.mUserData = null; page.mNeedsUnload = false; page.ClearBoundingBox(); } //Load the page page.SetRegion(info.Bounds.Left, info.Bounds.Top, info.Bounds.Right, info.Bounds.Bottom); mMainGeom.PageLoader.mGeomPage = page; mMainGeom.PageLoader.LoadPage(info); page.mUserData = info.UserData; page.Build(); page.IsVisible = page.mIsVisible; page.InactiveTime = 0; page.mIsLoaded = true; page.mIsFadeEnabled = false; }