From 2153965cf92ab61b0d7e095cf3c2755924fdc221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Juh=C3=A1sz?= Date: Thu, 1 Dec 2016 20:15:37 +0100 Subject: Line_of_sight: Improve using VoxelLineIterator This commit rewrites line_of_sight with VoxelLineIterator. Stepsize is no longer needed, the results will be always accurate. --- doc/lua_api.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 0637c346b..59884621b 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -2876,13 +2876,12 @@ and `minetest.auth_reload` call the authentication handler. * parameter was absent) * `minetest.delete_area(pos1, pos2)` * delete all mapblocks in the area from pos1 to pos2, inclusive -* `minetest.line_of_sight(pos1, pos2, stepsize)`: returns `boolean, pos` - * Check if there is a direct line of sight between `pos1` and `pos2` +* `minetest.line_of_sight(pos1, pos2)`: returns `boolean, pos` + * Checks if there is anything other than air between pos1 and pos2. + * Returns false if something is blocking the sight. * Returns the position of the blocking node when `false` * `pos1`: First position * `pos2`: Second position - * `stepsize`: smaller gives more accurate results but requires more computing - time. Default is `1`. * `minetest.raycast(pos1, pos2, objects, liquids)`: returns `Raycast` * Creates a `Raycast` object. * `pos1`: start of the ray -- cgit v1.2.3