1
This commit is contained in:
parent
2c1c3e740d
commit
fbcc2df714
@ -9,6 +9,7 @@
|
|||||||
#include "glmhelper.h"
|
#include "glmhelper.h"
|
||||||
#include "target_agent.h"
|
#include "target_agent.h"
|
||||||
#include "weapon.h"
|
#include "weapon.h"
|
||||||
|
#include "mapinstance.h"
|
||||||
|
|
||||||
#include "mt/Hero.h"
|
#include "mt/Hero.h"
|
||||||
#include "mt/Equip.h"
|
#include "mt/Equip.h"
|
||||||
@ -171,7 +172,27 @@ glm::vec3 HeroAgent::GetTargetDir()
|
|||||||
|
|
||||||
glm::vec3 HeroAgent::RandomPoint(const glm::vec3& center, float range)
|
glm::vec3 HeroAgent::RandomPoint(const glm::vec3& center, float range)
|
||||||
{
|
{
|
||||||
abort();
|
glm::vec3 hit_point;
|
||||||
|
bool hit_result = false;
|
||||||
|
|
||||||
|
glm::vec3 start = center;
|
||||||
|
glm::vec3 dir = GlmHelper::UP;
|
||||||
|
GlmHelper::RotateY(dir, (10 + rand() % 360)/ 180.0f);
|
||||||
|
GlmHelper::Normalize(dir);
|
||||||
|
glm::vec3 end = center + dir * range;
|
||||||
|
|
||||||
|
owner_->room->map_instance->Scale(start);
|
||||||
|
owner_->room->map_instance->Scale(end);
|
||||||
|
if (owner_->room->map_instance->Raycast
|
||||||
|
(
|
||||||
|
start,
|
||||||
|
end,
|
||||||
|
hit_point,
|
||||||
|
hit_result
|
||||||
|
)) {
|
||||||
|
owner_->room->map_instance->Scale(hit_point);
|
||||||
|
}
|
||||||
|
return hit_point;
|
||||||
}
|
}
|
||||||
|
|
||||||
float HeroAgent::GetShotRange()
|
float HeroAgent::GetShotRange()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user