Пример #1
0
 /// <summary>
 /// Gets the local boundary data for the agent.
 /// </summary>
 /// <remarks>
 /// <para>
 /// Only available after after a <see cref="CrowdManager"/> update.
 /// </para>
 /// <para>
 /// This data is not updated every frame.  So the boundary center will not always
 /// equal the position of the agent.
 /// </para>
 /// </remarks>
 /// <param name="buffer">A buffer to load with the boundary data. (Out)</param>
 /// <seealso cref="LocalBoundaryData"/>
 public void GetBoundary(LocalBoundaryData buffer)
 {
     if (!IsDisposed)
     {
         CrowdAgentEx.dtcaGetLocalBoundary(root, buffer);
     }
 }
Пример #2
0
        /// <summary>
        /// Gets the agent configuration.
        /// </summary>
        /// <returns>The agent configuration.</returns>
        public CrowdAgentParams GetConfig()
        {
            CrowdAgentParams config = new CrowdAgentParams();

            if (!IsDisposed)
            {
                CrowdAgentEx.dtcaGetAgentParams(root, ref config);
            }
            return(config);
        }
Пример #3
0
 /// <summary>
 /// Gets the local corner data for the agent.
 /// </summary>
 /// <remarks>
 /// <para>
 /// Only available after after a <see cref="CrowdManager"/> update.
 /// </para>
 /// <para>
 /// <b>Warning:</b> The buffer object must be sized to <see cref="CornerData.MarshalBufferSize"/>!
 /// </para>
 /// </remarks>
 /// <param name="buffer">
 /// The buffer to load with corner data. (Out) [Required:
 /// <see cref="CornerData.MaxCorners"/> = <see cref="CornerData.MarshalBufferSize"/>]
 /// </param>
 /// <returns>True if the data was sucessfully retrieved.</returns>
 public bool GetCornerData(CornerData buffer)
 {
     // This is only a partial argument validation.
     if (IsDisposed ||
         buffer == null ||
         buffer.polyRefs.Length != CornerData.MarshalBufferSize)
     {
         return(false);
     }
     CrowdAgentEx.dtcaGetAgentCorners(root, buffer);
     return(true);
 }
Пример #4
0
 /// <summary>
 /// Gets the corridor data related to the agent.
 /// </summary>
 /// <remarks>
 /// <para>
 /// Only available after after a <see cref="CrowdManager"/> update.
 /// </para>
 /// <para>
 /// <b>Warning:</b> The buffer object must be sized to a maximum path size equal to
 /// <see cref="PathCorridorData.MarshalBufferSize"/>!
 /// </para>
 /// </remarks>
 /// <param name="buffer">
 /// A buffer to load with the corridor data. (Out)
 /// [Length: Maximum Path Size =
 /// <see cref="PathCorridorData.MarshalBufferSize"/>]
 /// </param>
 /// <returns>True if the data was sucessfully retrieved.</returns>
 public bool GetCorridor(PathCorridorData buffer)
 {
     // Only a partial validation.
     if (IsDisposed ||
         buffer == null ||
         buffer.path.Length != PathCorridorData.MarshalBufferSize)
     {
         return(false);
     }
     CrowdAgentEx.dtcaGetPathCorridorData(root, buffer);
     return(true);
 }
Пример #5
0
        /// <summary>
        /// Gets data related to the neighbors in the vicinity of the agent.
        /// </summary>
        /// <remarks>
        /// <para>
        /// Only available after after a <see cref="CrowdManager"/> update.
        /// </para>
        /// </remarks>
        /// <param name="buffer">
        /// A buffer to load with the neighbor data.
        /// [Length: >= <see cref="CrowdNeighbor.MaxNeighbors"/>]
        /// </param>
        /// <returns>The number of neighbors in the buffer, or -1 on error.</returns>
        public int GetNeighbors(CrowdNeighbor[] buffer)
        {
            if (IsDisposed ||
                buffer == null ||
                buffer.Length < CrowdNeighbor.MaxNeighbors)
            {
                return(-1);
            }

            int count = CrowdAgentEx.dtcaGetAgentNeighbors(root
                                                           , buffer
                                                           , buffer.Length);

            return(count);
        }