Ejemplo n.º 1
0
        /// <summary>
        /// Completely refinds and inventories ALL NstMapBounds in the scene, rather than dicking around trying to be efficient. This is editor only so just brute force will do.
        /// </summary>
        /// <returns></returns>
        public static string WorldBoundsSummary()
        {
            // Find every damn NSTMapBounds in the scene currently and get its bounds.
            NSTMapBounds[] all = Resources.FindObjectsOfTypeAll <NSTMapBounds>();
            foreach (NSTMapBounds mb in all)
            {
                PrefabType type = PrefabUtility.GetPrefabType(mb);
                if (type != PrefabType.Prefab || type != PrefabType.ModelPrefab)
                {
                    mb.CollectMyBounds();
                }
            }

            NSTMapBounds.RecalculateCombinedBounds(true);
            NSTMapBounds.NotifyOtherClassesOfBoundsChange(true);

            return
                ("World Bounds \n" +
                 ((NSTMapBounds.ActiveBoundsCount == 0) ?
                  ("No Active NSTMapBounds - using default.\n") :
                  ("(All " + NSTMapBounds.ActiveBoundsCount + " NSTMapBound(s) combined):\n")
                 ) +

                 "Center: " + NSTMapBounds.CombinedWorldBounds.center + "\n" +
                 "Size: " + NSTMapBounds.CombinedWorldBounds.size + "\n\n" +

                 "Root position keyframes will use:\n" +
                 "x:" + WorldVectorCompression.axisRanges[0].bits + " bits, y:" + WorldVectorCompression.axisRanges[1].bits + "bits, and z:" + WorldVectorCompression.axisRanges[2].bits + "\n\n" +

                 "Root position lowerbit delta frames will use:\n" +
                 "x:" + WorldVectorCompression.axisRanges[0].lowerBits + " bits, y:" + WorldVectorCompression.axisRanges[1].lowerBits + "bits, and z:" + WorldVectorCompression.axisRanges[2].lowerBits
                );
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Completely refinds and inventories ALL NstMapBounds in the scene, rather than dicking around trying to be efficient.
        /// This is editor only so just brute force will do... because I don't see an 'efficient' way.
        /// </summary>
        /// <returns></returns>
        public static string WorldBoundsSummary()
        {
            NSTMapBounds.ResetActiveBounds();

            // Find every damn NSTMapBounds in the scene currently and get its bounds
            NSTMapBounds[] all = Object.FindObjectsOfType <NSTMapBounds>();

            foreach (NSTMapBounds mb in all)
            {
                mb.CollectMyBounds();
            }

            NSTMapBounds.RecalculateWorldCombinedBounds();
            NSTMapBounds.UpdateWorldBounds(true);

            string str =
                "World Bounds in current scene:\n" +
                ((NSTMapBounds.ActiveBoundsObjCount == 0) ?
                 ("No Active NSTMapBounds - will use default.\n") :
                 ("(" + NSTMapBounds.ActiveBoundsObjCount + " NSTMapBound(s) combined):\n")
                ) +

                "Center: " + NSTMapBounds.CombinedWorldBounds.center + "\n" +
                "Size: " + NSTMapBounds.CombinedWorldBounds.size + "\n\n" +

                "Root position keyframes will use:";

            for (BitCullingLevel bcl = 0; bcl < BitCullingLevel.DropAll; bcl++)
            {
                str += "\n\n" +
                       "Culling Level: " + System.Enum.GetName(typeof(BitCullingLevel), bcl) + "\n" +
                       "x: " + WorldVectorCompression.axisRanges[0].BitsAtCullLevel(bcl) + " bits, " +
                       "y: " + WorldVectorCompression.axisRanges[1].BitsAtCullLevel(bcl) + " bits, " +
                       "z: " + WorldVectorCompression.axisRanges[2].BitsAtCullLevel(bcl) + " bits, ";
            }

            return(str);
        }