This commit is contained in:
aozhiwei 2022-11-29 14:00:51 +08:00
parent 2a9ca0ead9
commit 0830650add
2 changed files with 8 additions and 10 deletions

View File

@ -37,8 +37,8 @@ struct NavMeshSetHeader
struct NavMeshTileHeader
{
dtTileRef tileRef;
int dataSize;
dtTileRef tileRef;
int dataSize;
};
void MapInstance::Init()
@ -652,10 +652,7 @@ int MapInstance::FindRandomPointAroundCircle(int layer,
return 0;
}
int MapInstance::Raycast(int layer,
const a8::Vec3& start,
const a8::Vec3& end,
std::vector<a8::Vec3>& hit_points)
int MapInstance::Raycast(int layer, const a8::Vec3& start, const a8::Vec3& end, a8::Vec3& hit_point)
{
float hitPoint[3];
@ -706,5 +703,9 @@ int MapInstance::Raycast(int layer,
}
}
hit_point.x = hitPoint[0];
hit_point.y = hitPoint[1];
hit_point.z = hitPoint[2];
return 1;
}

View File

@ -49,10 +49,7 @@ class MapInstance
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);
int Raycast(int layer, const a8::Vec3& start, const a8::Vec3& end, a8::Vec3& hit_point);
private:
void CreateThings();