This commit is contained in:
aozhiwei 2022-12-02 11:48:27 +08:00
parent 97057b81c2
commit 3afdaf0f2f

View File

@ -9,6 +9,7 @@
#include "player.h" #include "player.h"
#include "app.h" #include "app.h"
#include "car.h" #include "car.h"
#include "mapinstance.h"
const int SHUA_RANGE = 580; const int SHUA_RANGE = 580;
@ -468,6 +469,35 @@ void AndroidAI::UpdatePursuit()
ChangeToStateNewAI(ASE_Attack); ChangeToStateNewAI(ASE_Attack);
} else { } else {
#ifdef MAP3D #ifdef MAP3D
a8::Vec3 center;
glm::vec3 random_pt;
center.x = myself->GetPos().x;
center.y = 0;
center.z = myself->GetPos().y;
int ret = myself->room->map_instance->FindRandomPointAroundCircle
(0,
center,
GetAttackRange() / 10.f,
random_pt
);
if (ret > 0) {
a8::Vec3 start = center;
a8::Vec3 end;
end.x = random_pt.x;
end.y = random_pt.y;
end.z = random_pt.z;
std::vector<a8::Vec3> paths;
int ret = myself->room->map_instance->FindStraightPath
(
0,
start,
end,
paths
);
if (ret > 0) {
}
}
#else #else
if (node_->exec_frame_num > 100 * 2) { if (node_->exec_frame_num > 100 * 2) {
ChangeToStateNewAI(ASE_RandomWalk); ChangeToStateNewAI(ASE_RandomWalk);