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

@ -652,10 +652,7 @@ int MapInstance::FindRandomPointAroundCircle(int layer,
return 0; return 0;
} }
int MapInstance::Raycast(int layer, int MapInstance::Raycast(int layer, const a8::Vec3& start, const a8::Vec3& end, a8::Vec3& hit_point)
const a8::Vec3& start,
const a8::Vec3& end,
std::vector<a8::Vec3>& hit_points)
{ {
float hitPoint[3]; 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; return 1;
} }

View File

@ -49,10 +49,7 @@ class MapInstance
std::vector<a8::Vec3>& points, std::vector<a8::Vec3>& points,
unsigned int max_points, unsigned int max_points,
float max_radius); float max_radius);
int Raycast(int layer, int Raycast(int layer, const a8::Vec3& start, const a8::Vec3& end, a8::Vec3& hit_point);
const a8::Vec3& start,
const a8::Vec3& end,
std::vector<a8::Vec3>& hit_points);
private: private:
void CreateThings(); void CreateThings();