forked from Mirrorlandia_minetest/minetest
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:
parent
e7dbd325d2
commit
1d9c9710d7
@ -8403,6 +8403,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 = 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.
|
-- 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.
|
-- 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,
|
pointable = true,
|
||||||
|
@ -1826,8 +1826,8 @@ void ServerEnvironment::getSelectedActiveObjects(
|
|||||||
const std::optional<Pointabilities> &pointabilities)
|
const std::optional<Pointabilities> &pointabilities)
|
||||||
{
|
{
|
||||||
std::vector<ServerActiveObject *> objs;
|
std::vector<ServerActiveObject *> objs;
|
||||||
getObjectsInsideRadius(objs, shootline_on_map.start,
|
getObjectsInsideRadius(objs, shootline_on_map.getMiddle(),
|
||||||
shootline_on_map.getLength() + 10.0f, nullptr);
|
0.5 * shootline_on_map.getLength() + 5 * BS, nullptr);
|
||||||
const v3f line_vector = shootline_on_map.getVector();
|
const v3f line_vector = shootline_on_map.getVector();
|
||||||
|
|
||||||
for (auto obj : objs) {
|
for (auto obj : objs) {
|
||||||
|
Loading…
Reference in New Issue
Block a user