/// <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); }
/// <summary> /// Loads the corridor data into the provided <see cref="PathCorridorData"/> buffer. /// </summary> /// <remarks> /// <para> /// Make sure the buffer is sized to hold the entire result. /// (See: <see cref="GetPathCount"/> and <see cref="MaxPathSize"/>.) /// </para> /// </remarks> /// <param name="buffer"> /// The buffer to load the data into. /// [Length: Maximum Path Size >= <see cref="GetPathCount"/>] /// </param> /// <returns>False if the operation failed.</returns> public bool GetData(PathCorridorData buffer) { // Only performs a partial parameter validation. if (buffer == null || buffer.path == null || buffer.path.Length < 1) { return(false); } if (buffer.path.Length == PathCorridorData.MarshalBufferSize) { return(PathCorridorEx.dtpcGetData(mRoot, buffer)); } buffer.pathCount = GetPath(buffer.path); buffer.position = mPosition.point; buffer.target = mTarget.point; return(true); }
/// <summary> /// Loads the corridor data into the provided <see cref="PathCorridorData"/> buffer. /// </summary> /// <remarks> /// <para> /// Make sure the buffer is sized to hold the entire result. /// (See: <see cref="GetPathCount"/> and <see cref="MaxPathSize"/>.) /// </para> /// </remarks> /// <param name="buffer"> /// The buffer to load the data into. /// [Length: Maximum Path Size >= <see cref="GetPathCount"/>] /// </param> /// <returns>False if the operation failed.</returns> public bool GetData(PathCorridorData buffer) { // Only performs a partial parameter validation. if (buffer == null|| buffer.path == null|| buffer.path.Length < 1) return false; if (buffer.path.Length == PathCorridorData.MarshalBufferSize) return PathCorridorEx.dtpcGetData(mRoot, buffer); buffer.pathCount = GetPath(buffer.path); buffer.position = mPosition.point; buffer.target = mTarget.point; return true; }
/// <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; }