/* Copyright (c) 2009-2010 Mikko Mononen memon@inside.org recast4j copyright (c) 2015-2019 Piotr Piastucki piotr@jtilia.org DotRecast Copyright (c) 2023 Choi Ikpil ikpil@naver.com This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ using System; using System.Collections.Generic; using DotRecast.Core; namespace DotRecast.Detour.Crowd { /// Represents an agent managed by a #dtCrowd object. /// @ingroup crowd public class DtCrowdAgent { public readonly long idx; /// The type of mesh polygon the agent is traversing. (See: #CrowdAgentState) public CrowdAgentState state; /// True if the agent has valid path (targetState == DT_CROWDAGENT_TARGET_VALID) and the path does not lead to the /// requested position, else false. public bool partial; /// The path corridor the agent is using. public DtPathCorridor corridor; /// The local boundary data for the agent. public DtLocalBoundary boundary; /// Time since the agent's path corridor was optimized. public float topologyOptTime; /// The known neighbors of the agent. public List neis = new List(); /// The desired speed. public float desiredSpeed; public RcVec3f npos = new RcVec3f(); /// < The current agent position. [(x, y, z)] public RcVec3f disp = new RcVec3f(); /// < A temporary value used to accumulate agent displacement during iterative /// collision resolution. [(x, y, z)] public RcVec3f dvel = new RcVec3f(); /// < The desired velocity of the agent. Based on the current path, calculated /// from /// scratch each frame. [(x, y, z)] public RcVec3f nvel = new RcVec3f(); /// < The desired velocity adjusted by obstacle avoidance, calculated from scratch each /// frame. [(x, y, z)] public RcVec3f vel = new RcVec3f(); /// < The actual velocity of the agent. The change from nvel -> vel is /// constrained by max acceleration. [(x, y, z)] /// The agent's configuration parameters. public DtCrowdAgentParams option; /// The local path corridor corners for the agent. public List corners = new List(); public MoveRequestState targetState; /// < State of the movement request. public long targetRef; /// < Target polyref of the movement request. public RcVec3f targetPos = new RcVec3f(); /// < Target position of the movement request (or velocity in case of /// DT_CROWDAGENT_TARGET_VELOCITY). public DtPathQueryResult targetPathQueryResult; /// < Path finder query public bool targetReplan; /// < Flag indicating that the current path is being replanned. public float targetReplanTime; ///