DtCrowdConfig.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. recast4j copyright (c) 2021 Piotr Piastucki piotr@jtilia.org
  3. DotRecast Copyright (c) 2023 Choi Ikpil ikpil@naver.com
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. namespace DotRecast.Detour.Crowd
  19. {
  20. public class DtCrowdConfig
  21. {
  22. public readonly float maxAgentRadius;
  23. /**
  24. * Max number of path requests in the queue
  25. */
  26. public int pathQueueSize = 32;
  27. /**
  28. * Max number of sliced path finding iterations executed per update (used to handle longer paths and replans)
  29. */
  30. public int maxFindPathIterations = 100;
  31. /**
  32. * Max number of sliced path finding iterations executed per agent to find the initial path to target
  33. */
  34. public int maxTargetFindPathIterations = 20;
  35. /**
  36. * Min time between topology optimizations (in seconds)
  37. */
  38. public float topologyOptimizationTimeThreshold = 0.5f;
  39. /**
  40. * The number of polygons from the beginning of the corridor to check to ensure path validity
  41. */
  42. public int checkLookAhead = 10;
  43. /**
  44. * Min time between target re-planning (in seconds)
  45. */
  46. public float targetReplanDelay = 1.0f;
  47. /**
  48. * Max number of sliced path finding iterations executed per topology optimization per agent
  49. */
  50. public int maxTopologyOptimizationIterations = 32;
  51. public float collisionResolveFactor = 0.7f;
  52. /**
  53. * Max number of neighbour agents to consider in obstacle avoidance processing
  54. */
  55. public int maxObstacleAvoidanceCircles = 6;
  56. /**
  57. * Max number of neighbour segments to consider in obstacle avoidance processing
  58. */
  59. public int maxObstacleAvoidanceSegments = 8;
  60. public DtCrowdConfig(float maxAgentRadius)
  61. {
  62. this.maxAgentRadius = maxAgentRadius;
  63. }
  64. }
  65. }