This commit is contained in:
aozhiwei 2023-01-11 14:17:33 +08:00
parent eca6af39d3
commit bdbb810a6f

View File

@ -444,7 +444,7 @@ bool MapInstance::Raycast(int layer, const glm::vec3& start, const glm::vec3& en
} }
} }
if (!ok){ if (!ok){
for (int i = 0; i < 3; ++i) { for (int i = 0; i < 30; ++i) {
hit_pos_copy[0] -= dir.x; hit_pos_copy[0] -= dir.x;
hit_pos_copy[2] -= dir.z; hit_pos_copy[2] -= dir.z;
for (int ii = npolys - 1; ii >= 0; --ii) { for (int ii = npolys - 1; ii >= 0; --ii) {
@ -459,7 +459,7 @@ bool MapInstance::Raycast(int layer, const glm::vec3& start, const glm::vec3& en
} }
} }
dtVcopy(hit_pos_copy, hit_pos_); dtVcopy(hit_pos_copy, hit_pos_);
for (int i = 0; i < 3; ++i) { for (int i = 0; i < 30; ++i) {
hit_pos_copy[0] += dir.x; hit_pos_copy[0] += dir.x;
hit_pos_copy[2] += dir.z; hit_pos_copy[2] += dir.z;
for (int ii = npolys - 1; ii >= 0; --ii) { for (int ii = npolys - 1; ii >= 0; --ii) {