1
This commit is contained in:
parent
a9c166cb32
commit
68a98a1d45
@ -144,7 +144,7 @@ void MapInstance::Init()
|
|||||||
}
|
}
|
||||||
#if 1
|
#if 1
|
||||||
{
|
{
|
||||||
dtTileRef tile_ref = navmesh_->getTileRefAt(10, 10, 0);
|
dtTileRef tile_ref = navmesh_->getTileRefAt(0, 0, 0);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -621,3 +621,28 @@ a8::Vec2* MapInstance::GetSpawnPoint(const std::string& name)
|
|||||||
auto itr = spawn_name_hash_.find(name);
|
auto itr = spawn_name_hash_.find(name);
|
||||||
return itr != spawn_name_hash_.end() ? &itr->second : nullptr;
|
return itr != spawn_name_hash_.end() ? &itr->second : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int MapInstance::FindStraightPath(int layer,
|
||||||
|
const a8::Vec3& start,
|
||||||
|
const a8::Vec3& end,
|
||||||
|
std::vector<a8::Vec3>& paths)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int MapInstance::FindRandomPointAroundCircle(int layer,
|
||||||
|
const a8::Vec3& center_pos,
|
||||||
|
std::vector<a8::Vec3>& points,
|
||||||
|
unsigned int max_points,
|
||||||
|
float max_radius)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int MapInstance::Raycast(int layer,
|
||||||
|
const a8::Vec3& start,
|
||||||
|
const a8::Vec3& end,
|
||||||
|
std::vector<a8::Vec3>& hit_points)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "DetourNavMesh.h"
|
#include "DetourNavMesh.h"
|
||||||
|
#include "DetourNavMeshQuery.h"
|
||||||
|
|
||||||
|
#include <a8/vec2.h>
|
||||||
|
#include <a8/vec3.h>
|
||||||
|
|
||||||
namespace MetaData
|
namespace MetaData
|
||||||
{
|
{
|
||||||
@ -33,7 +37,22 @@ class MapInstance
|
|||||||
MetaData::Map* GetMapMeta() { return map_meta_; }
|
MetaData::Map* GetMapMeta() { return map_meta_; }
|
||||||
Entity* GetEntityByUniId(int uniid);
|
Entity* GetEntityByUniId(int uniid);
|
||||||
a8::Vec2* GetSpawnPoint(const std::string& name);
|
a8::Vec2* GetSpawnPoint(const std::string& name);
|
||||||
|
|
||||||
dtNavMesh* GetNavMesh() { return navmesh_; };
|
dtNavMesh* GetNavMesh() { return navmesh_; };
|
||||||
|
dtNavMeshQuery* GetNavMeshQuery() { return navmesh_query_; };
|
||||||
|
int FindStraightPath(int layer,
|
||||||
|
const a8::Vec3& start,
|
||||||
|
const a8::Vec3& end,
|
||||||
|
std::vector<a8::Vec3>& paths);
|
||||||
|
int FindRandomPointAroundCircle(int layer,
|
||||||
|
const a8::Vec3& center_pos,
|
||||||
|
std::vector<a8::Vec3>& points,
|
||||||
|
unsigned int max_points,
|
||||||
|
float max_radius);
|
||||||
|
int Raycast(int layer,
|
||||||
|
const a8::Vec3& start,
|
||||||
|
const a8::Vec3& end,
|
||||||
|
std::vector<a8::Vec3>& hit_points);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void CreateThings();
|
void CreateThings();
|
||||||
@ -52,6 +71,7 @@ class MapInstance
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
dtNavMesh* navmesh_ = nullptr;
|
dtNavMesh* navmesh_ = nullptr;
|
||||||
|
dtNavMeshQuery* navmesh_query_ = nullptr;
|
||||||
|
|
||||||
int current_uniid_ = 0;
|
int current_uniid_ = 0;
|
||||||
int current_map_block_uniid_ = 0;
|
int current_map_block_uniid_ = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user