/// <summary> /// Draws the basic agent debug information. /// </summary> /// <remarks> /// <para> /// This does not include the duplicate agent information such as target and corner /// positions. /// </para> /// </remarks> /// <param name="agent">The agent to draw.</param> public void DrawBase(CrowdAgent agent) { Vector3 pos = agent.Position; CrowdAgentParams config = agent.GetConfig(); DebugDraw.Circle(pos, config.radius, neighborColor); DebugDraw.Arrow(pos + Vector3.up * config.height , pos + agent.DesiredVelocity + Vector3.up * config.height , 0, 0.05f, desiredVelocityColor); DebugDraw.Arrow(pos + Vector3.up * config.height , pos + agent.Velocity + Vector3.up * config.height , 0, 0.05f, velocityColor); }
/// <summary> /// Draws agent neighbor information. /// </summary> /// <param name="agent">The agent to draw.</param> public void DrawNeighbors(CrowdAgent agent) { int neighborCount = agent.NeighborCount; if (neighborCount == 0) { return; } agent.GetNeighbors(neighbors); for (int i = 0; i < neighborCount; i++) { CrowdAgent n = agent.GetNeighbor(neighbors[i]); if (n == null) { // Not sure why this happens. Bug in CrowdAgent? continue; } DebugDraw.Arrow(agent.Position, n.Position, 0, 0.05f, neighborColor); DebugDraw.Circle(n.Position, agent.GetConfig().radius, neighborColor); } }
/// <summary> /// Draws agent neighbor information. /// </summary> /// <param name="agent">The agent to draw.</param> public void DrawNeighbors(CrowdAgent agent) { int neighborCount = agent.NeighborCount; if (neighborCount == 0) return; agent.GetNeighbors(neighbors); for (int i = 0; i < neighborCount; i++) { CrowdAgent n = agent.GetNeighbor(neighbors[i]); if (n == null) // Not sure why this happens. Bug in CrowdAgent? continue; DebugDraw.Arrow(agent.Position, n.Position, 0, 0.05f, neighborColor); DebugDraw.Circle(n.Position, agent.GetConfig().radius, neighborColor); } }