Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix short raycasts missing large objects #14339

Merged
merged 2 commits into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/lua_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8397,6 +8397,8 @@ Player properties need to be saved manually.
-- If `rotate = false`, the selection box will not rotate with the object itself, remaining fixed to the axes.
-- If `rotate = true`, it will match the object's rotation and any attachment rotations.
-- Raycasts use the selection box and object's rotation, but do *not* obey attachment rotations.
-- For server-side raycasts to work correctly,
-- the selection box should extend at most 5 units in each direction.


pointable = true,
Expand Down
4 changes: 2 additions & 2 deletions src/serverenvironment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1834,8 +1834,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) {
Expand Down