Пример #1
0
        /// <summary>
        /// Gets the tile header from the raw tile data.
        /// </summary>
        /// <param name="rawTileData">The raw tile data.</param>
        /// <param name="header">The header.</param>
        /// <returns>The status of the request.</returns>
        public static NavStatus GetHeader(byte[] rawTileData, out NavmeshTileHeader header)
        {
            header = new NavmeshTileHeader();

            if (rawTileData == null)
                return NavStatus.Failure | NavStatus.InvalidParam;

            return NavmeshTileEx.dtnmGetTileDataHeader(rawTileData, rawTileData.Length, ref header);
        }
Пример #2
0
        /// <summary>
        /// Derives the <see cref="NavmeshParams"/> for a tile.
        /// </summary>
        /// <remarks>
        /// <para>
        /// This method is useful for getting the configuration required to build a single-tile
        /// navigation mesh for the tile.
        /// </para>
        /// </remarks>
        /// <param name="tile">The tile.</param>
        /// <returns>The <see cref="NavmeshParams"/> for the tile.</returns>
        public static NavmeshParams DeriveConfig(NavmeshTileData tile)
        {
            NavmeshTileHeader header = tile.GetHeader();

            return(new NavmeshParams(header.boundsMin
                                     , header.boundsMax.x - header.boundsMin.x
                                     , header.boundsMax.z - header.boundsMin.z
                                     , 1 // Max tiles.
                                     , header.polyCount));
        }
Пример #3
0
        /// <summary>
        /// Gets the tile header.
        /// </summary>
        /// <returns>The tile header.</returns>
        public NavmeshTileHeader GetHeader()
        {
            NavmeshTileHeader result = new NavmeshTileHeader();

            if (mData == IntPtr.Zero)
                return new NavmeshTileHeader();

            NavmeshTileEx.dtnmGetTileDataHeaderAlt(mData, mDataLength, ref result);

            return result;
        }
Пример #4
0
        /// <summary>
        /// Gets the tile header.
        /// </summary>
        /// <returns>The tile header.</returns>
        public NavmeshTileHeader GetHeader()
        {
            NavmeshTileHeader result = new NavmeshTileHeader();

            if (mData == IntPtr.Zero)
                return new NavmeshTileHeader();

            NavmeshTileEx.dtnmGetTileDataHeaderAlt(mData, mDataLength, ref result);

            return result;
        }
Пример #5
0
        /// <summary>
        /// Gets the tile header from the raw tile data.
        /// </summary>
        /// <param name="rawTileData">The raw tile data.</param>
        /// <param name="header">The header.</param>
        /// <returns>The status of the request.</returns>
        public static NavStatus GetHeader(byte[] rawTileData, out NavmeshTileHeader header)
        {
            header = new NavmeshTileHeader();

            if (rawTileData == null)
                return NavStatus.Failure | NavStatus.InvalidParam;

            return NavmeshTileEx.dtnmGetTileDataHeader(rawTileData, rawTileData.Length, ref header);
        }