1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Fix short raycasts missing large objects (#14339)

Increases the tolerance from one node to five nodes.
Also optimizes the "sphere" used for pre-filtering entities
to start in the middle of the line segment rather than at the start.
This commit is contained in:
Lars Müller 2024-02-04 14:04:05 +01:00 committed by GitHub
parent e7dbd325d2
commit 1d9c9710d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -1826,8 +1826,8 @@ void ServerEnvironment::getSelectedActiveObjects(
const std::optional<Pointabilities> &pointabilities)
{
std::vector<ServerActiveObject *> objs;
getObjectsInsideRadius(objs, shootline_on_map.start,
shootline_on_map.getLength() + 10.0f, nullptr);
getObjectsInsideRadius(objs, shootline_on_map.getMiddle(),
0.5 * shootline_on_map.getLength() + 5 * BS, nullptr);
const v3f line_vector = shootline_on_map.getVector();
for (auto obj : objs) {