CrowdManager.pkg 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. $#include "Navigation/CrowdManager.h"
  2. class CrowdManager : public Component
  3. {
  4. void DrawDebugGeometry(bool depthTest);
  5. void SetCrowdTarget(const Vector3& position, Node* node = 0);
  6. void SetCrowdVelocity(const Vector3& velocity, Node* node = 0);
  7. void ResetCrowdTarget(Node* node = 0);
  8. void SetMaxAgents(unsigned agentCt);
  9. void SetMaxAgentRadius(float maxAgentRadius);
  10. void SetNavigationMesh(NavigationMesh *navMesh);
  11. void SetIncludeFlags(unsigned queryFilterType, unsigned short flags);
  12. void SetExcludeFlags(unsigned queryFilterType, unsigned short flags);
  13. void SetAreaCost(unsigned queryFilterType, unsigned areaID, float cost);
  14. void SetObstacleAvoidanceParams(unsigned obstacleAvoidanceType, const CrowdObstacleAvoidanceParams& params);
  15. PODVector<CrowdAgent*> GetAgents(Node* node = 0, bool inCrowdFilter = true) const;
  16. Vector3 FindNearestPoint(const Vector3& point, int queryFilterType);
  17. Vector3 MoveAlongSurface(const Vector3& start, const Vector3& end, int queryFilterType, int maxVisited = 3);
  18. tolua_outside const PODVector<Vector3>& CrowdManagerFindPath @ FindPath(const Vector3& start, const Vector3& end, int queryFilterType);
  19. Vector3 GetRandomPoint(int queryFilterType);
  20. Vector3 GetRandomPointInCircle(const Vector3& center, float radius, int queryFilterType);
  21. float GetDistanceToWall(const Vector3& point, float radius, int queryFilterType, Vector3* hitPos = 0, Vector3* hitNormal = 0);
  22. Vector3 Raycast(const Vector3& start, const Vector3& end, int queryFilterType, Vector3* hitNormal = 0);
  23. unsigned GetMaxAgents() const;
  24. float GetMaxAgentRadius() const;
  25. NavigationMesh* GetNavigationMesh() const;
  26. unsigned GetNumQueryFilterTypes() const;
  27. unsigned GetNumAreas(unsigned queryFilterType) const;
  28. unsigned short GetIncludeFlags(unsigned queryFilterType) const;
  29. unsigned short GetExcludeFlags(unsigned queryFilterType) const;
  30. float GetAreaCost(unsigned queryFilterType, unsigned areaID) const;
  31. unsigned GetNumObstacleAvoidanceTypes() const;
  32. const CrowdObstacleAvoidanceParams& GetObstacleAvoidanceParams(unsigned obstacleAvoidanceType) const;
  33. tolua_property__get_set int maxAgents;
  34. tolua_property__get_set float maxAgentRadius;
  35. tolua_property__get_set NavigationMesh* navigationMesh;
  36. };
  37. ${
  38. const PODVector<Vector3>& CrowdManagerFindPath(CrowdManager* crowdManager, const Vector3& start, const Vector3& end, int queryFilterType)
  39. {
  40. static PODVector<Vector3> dest;
  41. dest.Clear();
  42. crowdManager->FindPath(dest, start, end, queryFilterType);
  43. return dest;
  44. }
  45. $}