This commit is contained in:
aozhiwei 2022-12-02 11:37:02 +08:00
parent ac12bd057d
commit b3046a9c2c
2 changed files with 10 additions and 7 deletions

View File

@ -753,9 +753,8 @@ int MapInstance::FindStraightPath(int layer,
int MapInstance::FindRandomPointAroundCircle(int layer, int MapInstance::FindRandomPointAroundCircle(int layer,
const a8::Vec3& center_pos, const a8::Vec3& center_pos,
std::vector<a8::Vec3>& points, float max_radius,
unsigned int max_points, glm::vec3& random_pt)
float max_radius)
{ {
dtQueryFilter filter; dtQueryFilter filter;
filter.setIncludeFlags(0xffff); filter.setIncludeFlags(0xffff);
@ -788,8 +787,13 @@ int MapInstance::FindRandomPointAroundCircle(int layer,
randomPt); randomPt);
if (dtStatusSucceed(status)) { if (dtStatusSucceed(status)) {
} random_pt.x = randomPt[0];
random_pt.y = randomPt[1];
random_pt.z = randomPt[2];
return 1;
} else {
return 0; return 0;
}
} }
int MapInstance::Raycast(int layer, const glm::vec3& start, const glm::vec3& end, glm::vec3& hit_point) int MapInstance::Raycast(int layer, const glm::vec3& start, const glm::vec3& end, glm::vec3& hit_point)

View File

@ -46,9 +46,8 @@ class MapInstance
std::vector<a8::Vec3>& paths); std::vector<a8::Vec3>& paths);
int FindRandomPointAroundCircle(int layer, int FindRandomPointAroundCircle(int layer,
const a8::Vec3& center_pos, const a8::Vec3& center_pos,
std::vector<a8::Vec3>& points, float max_radius,
unsigned int max_points, glm::vec3& random_pt);
float max_radius);
int Raycast(int layer, const glm::vec3& start, const glm::vec3& end, glm::vec3& hit_point); int Raycast(int layer, const glm::vec3& start, const glm::vec3& end, glm::vec3& hit_point);
bool FindNearestPoint(const a8::Vec3& center, float radius, a8::Vec3& nearestPt); bool FindNearestPoint(const a8::Vec3& center, float radius, a8::Vec3& nearestPt);